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

20130 Commits

Author SHA1 Message Date
Anna Henningsen
c0f3bc24de
src: add helper for addons to get the event loop
Add a utility functions for addons to use when they need
a reference to the current event loop.

Currently, `uv_default_loop()` works if the embedder is the
single-threaded default node executable, but even without
the presence of e.g. workers that might not really an API
guarantee for when Node is embedded.

PR-URL: https://github.com/nodejs/node/pull/17109
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-11-21 08:33:19 +01:00
Ben Noordhuis
804eb3cd73 src: remove process._debugPause()
This method is undocumented and depends on a V8 API that is slated for
removal.  The inspector and node-inspect don't use it and I could find
no third-party code that depends on it.  Remove it.

PR-URL: https://github.com/nodejs/node/pull/17060
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-11-20 23:41:30 +01:00
Ben Noordhuis
f526deb040 src: inspector context name = program title + pid
Report (for example) "node[1337]" as the human-readable name rather
than the more generic and less helpful "Node.js Main Context."

While not perfect yet, it should be an improvement to people that
debug multiple processes from DevTools, VS Code, etc.

PR-URL: https://github.com/nodejs/node/pull/17087
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-11-20 23:37:50 +01:00
Ben Noordhuis
7dc35e937d src: abstract getpid() operation
There are a few places where we paper over the fact that getpid() is
called GetCurrentProcessId() on Windows.  Let's move it into a function.

PR-URL: https://github.com/nodejs/node/pull/17087
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-11-20 23:37:50 +01:00
Rich Trott
65439b4c17 doc: normalize ToC indentation with heading levels in README
PR-URL: https://github.com/nodejs/node/pull/17106
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-11-20 14:06:02 -08:00
Rich Trott
345bfd8920 doc: add Contributing to Node.js to the README ToC
PR-URL: https://github.com/nodejs/node/pull/17106
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-11-20 14:05:58 -08:00
Rich Trott
67af8d82ee doc: merge Working Groups with Contributing to Node.js in README
PR-URL: https://github.com/nodejs/node/pull/17106
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-11-20 14:05:52 -08:00
Rich Trott
545a789af2 doc: remove IRC node-dev link from README
The IRC link is mentioned in CONTRIBUTING.md which is linked immediately
above. We should encourage people to read that doc before hoping on the
IRC channel.

PR-URL: https://github.com/nodejs/node/pull/17106
Ref: https://github.com/nodejs/node/pull/16533#discussion_r147292940
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-11-20 14:05:46 -08:00
Ed Schouten
336af9ac1f
build: Allow linking against an external copy of nghttp2.
The version of nghttp2 in deps/ does not build on CloudABI, even though
the official version does. Though this is an issue on its own that needs
to be resolved, it is currently a bit hard to work around this. There is
no switch to link against an external version of nghttp2, even though we
do provide this option for other libraries.

This change adds configure flags, similar to the ones we have for
OpenSSL, zlib, http_parser, libuv, etc. and makes the dependency on
deps/nghttp2 optional.

PR-URL: https://github.com/nodejs/node/pull/16788
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-11-20 14:25:33 -05:00
Gibson Fahnestock
ad1967d656
tools: allow running test.py without configuring
If config.gypi isn't defined, assume Node was build the default way,
i.e. with the inspector.

PR-URL: https://github.com/nodejs/node/pull/16621
Refs: https://github.com/nodejs/node/pull/16436#issuecomment-340115175
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2017-11-20 15:23:02 +00:00
Gibson Fahnestock
5c7b1ecbce
test: make debugging of inspector-port-zero easier
If the process was killed, then the exit code will be null, in which
case knowing the signal is really helpful.

PR-URL: https://github.com/nodejs/node/pull/16685
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-11-20 15:01:54 +00:00
sgreylyn
52010553d3
test: replace assert.throws w/ common.expectsError
PR-URL: https://github.com/nodejs/node/pull/17091
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2017-11-20 09:56:08 -05:00
Gibson Fahnestock
e51216d722
src: add NODE_VERSION_IS_LTS to node_version.h
This is defined in LTS releases, but should really be defined in master
too.

PR-URL: https://github.com/nodejs/node/pull/16697
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-11-20 14:24:33 +00:00
Joyee Cheung
289fcb05be
build: do not build doc in source tarball
PR-URL: https://github.com/nodejs/node/pull/17100
Fixes: https://github.com/nodejs/node/issues/16650
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-11-20 21:38:50 +08:00
Andreas Madsen
07a4fa3dbe
async_hooks: deprecate undocumented API
PR-URL: https://github.com/nodejs/node/pull/16972
Refs: https://github.com/nodejs/node/issues/14328
Refs: https://github.com/nodejs/node/issues/15572
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-11-20 12:03:06 +01:00
Luigi Pinca
97ba69f915 doc: add missing introduced_in comments
Add missing "introduced_in" comments for alternative version links.

PR-URL: https://github.com/nodejs/node/pull/16741
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
2017-11-19 18:10:05 +01:00
vladimir
51e0948862
domain: re-implement domain over async_hook
Domain core module has been re-implemented over async_hook.

PR-URL: https://github.com/nodejs/node/pull/16222
Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-11-19 17:39:19 +01:00
Franziska Hinkelmann
2d50b5e537
src: use unique_ptr for http2_state
PR-URL: https://github.com/nodejs/node/pull/17078
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-11-19 16:13:37 +01:00
Anna Henningsen
d61cd9d4fe
src: add missing include in node_platform.h
PR-URL: https://github.com/nodejs/node/pull/17133
Refs: https://github.com/nodejs/node/pull/17083
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
2017-11-19 14:20:43 +01:00
Rich Trott
5f720bebe7
test: reduce benchmark cases in test-benchmark-buffer
Specify `buffer=fast` so that we only run that and not that along with
`buffer=slow` in two benchmarks.

PR-URL: https://github.com/nodejs/node/pull/17111
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-11-19 12:33:06 +01:00
Franziska Hinkelmann
24e824ad68 src: use unique_ptr for scheduled delayed tasks
Use std::unique_ptr for delayed tasks in the scheduled
delayed tasks vector. This makes it clear that the vector
has ownership of the delayed tasks and is responsible for
deleting them.

Use a custom deleter for the pointers because libuv
needs to close the handle and then delete the data. Provide
the handle when creating the pointer instead of invoking the
special delete action everytime an element is removed from the vector.

PR-URL: https://github.com/nodejs/node/pull/17083
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-11-19 09:32:37 +01:00
Franziska Hinkelmann
f841fc63dd src: use std::unique_ptr in base-object-inl.h
Drive-by fix: delete superflouos nullptr in ptr.reset().

PR-URL: https://github.com/nodejs/node/pull/17079
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-11-19 09:20:26 +01:00
Rich Trott
ce6c7f5b01
doc: change v8 to V8
Google's V8 engine is styled "V8" and not "v8". Most Node.js docs style
it correctly. This change fixes a few instances that are not styled
correctly.

PR-URL: https://github.com/nodejs/node/pull/17089
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-11-18 22:25:05 +01:00
Patrick Heneise
8f8999c1c0
test: fs.write() if 3rd argument is a callback, not offset
Easier way to resolve conflicts from #16822 and #16827.

PR-URL: https://github.com/nodejs/node/pull/17045
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-11-18 22:09:08 +01:00
Luigi Pinca
9531fcbb2e
doc: avoid mentioning 'uncaughtException'
Avoid suggesting using `'uncaughtException'` for emitted errors.

PR-URL: https://github.com/nodejs/node/pull/16905
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-11-18 21:07:06 +01:00
Vipin Menon
fe932a1204
stream: use arrow fns for 'this' in readable
PR-URL: https://github.com/nodejs/node/pull/16927
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-11-18 21:05:39 +01:00
Mathias Bynens
42bdb66bf2
deps: cherry-pick upstream ICU fix
ICU 60.1 has a bug resulting in incorrect Script_Extensions data
for 5 characters.
http://bugs.icu-project.org/trac/ticket/13462

Upstream patch:
http://bugs.icu-project.org/trac/changeset/40667

Refs: https://bugs.chromium.org/p/v8/issues/detail?id=4743#c54
PR-URL: https://github.com/nodejs/node/pull/16931
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-11-18 21:02:50 +01:00
Anna Henningsen
8854598b42
src: remove superfluous check in backtrace_posix.cc
The error check doesn't matter because a failure would be ignored
as part of the loop condition.

PR-URL: https://github.com/nodejs/node/pull/16950
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2017-11-18 20:58:12 +01:00
Kevin Locke
662d803682
zlib: fix assert fail for bad write in object mode
add4b0ab8c introduced a regression from Node 8 to Node 9 by removing the
`ArrayBuffer.isView(chunk)` check in `Zlib.prototype._transform` without
properly forcing `opts.objectMode` to `false` in the constructor because
the change to `opts` occurs after `opts` has been passed to the
`Transform` constructor.  This commit fixes the issue by moving the call
to `Transform` after the changes to `opts`.

The regression can be demonstrated by running

    node -e 'require("zlib").Gunzip({objectMode: true}).write({})'

On Node 8 this correctly throws a `TypeError`:

    events.js:183
          throw er; // Unhandled 'error' event
          ^

    TypeError: invalid input
        at Gunzip._transform (zlib.js:367:15)
        at Gunzip.Transform._read (_stream_transform.js:186:10)
        at Gunzip.Transform._write (_stream_transform.js:174:12)
        at doWrite (_stream_writable.js:387:12)
        at writeOrBuffer (_stream_writable.js:373:5)
        at Gunzip.Writable.write (_stream_writable.js:290:11)
        at [eval]:1:44
        at ContextifyScript.Script.runInThisContext (vm.js:50:33)
        at Object.runInThisContext (vm.js:139:38)
        at Object.<anonymous> ([eval]-wrapper:6:22)

On Node 9 this causes an assertion failure:

    node[21732]: ../src/node_zlib.cc:179:static void node::{anonymous}::ZCtx::Write(const v8::FunctionCallbackInfo<v8::Value>&) [with bool async = true]: Assertion `Buffer::HasInstance(args[1])' failed.
     1: node::Abort() [node]
     2: node::Assert(char const* const (*) [4]) [node]
     3: 0x1250916 [node]
     4: v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo<v8::Value> const&)) [node]
     5: 0xb7547c [node]
     6: v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*) [node]
     7: 0x20c44b8842fd
    Aborted

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
PR-URL: https://github.com/nodejs/node/pull/16960
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-11-18 20:55:57 +01:00
Daniel Bevenius
6c5a39c51f
build: minor corrections to configure descriptions
PR-URL: https://github.com/nodejs/node/pull/17094
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-11-18 20:55:04 +01:00
Witthawat Piwawatthanapanit
078eaa9f98
src: fix size of CounterSet
PR-URL: https://github.com/nodejs/node/pull/16984
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-11-18 20:53:38 +01:00
buji
71ee0d9a40
util: escaping object keys in util.inspect()
PR-URL: https://github.com/nodejs/node/pull/16986
Fixes: https://github.com/nodejs/node/issues/16979
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
2017-11-18 20:52:08 +01:00
sreepurnajasti
95d9a58cbc
test: utilize common.mustCall() on child exit
PR-URL: https://github.com/nodejs/node/pull/16996
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-11-18 20:49:36 +01:00
buji
6244070c48
buffer: don't predefine error
PR-URL: https://github.com/nodejs/node/pull/17021
Fixes: https://github.com/nodejs/node/issues/16994
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-11-18 20:44:56 +01:00
Refael Ackermann
66e2751e0a
tools: bump remark-cli to 4.0
PR-URL: https://github.com/nodejs/node/pull/17028
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-11-18 20:44:17 +01:00
pimlie
adb7be2649
doc: add note about using cluster without networking
Although the primary use-case for the cluster module is networking, the
module provides a generic master/worker interface that could also be
used if you dont use networking at all. Currently the docs are a bit
ambiguous about this as only the primary use-case is ever mentioned,
this remark should clarify that the cluster module can also be used
without disadvantages if you dont use networking.

PR-URL: https://github.com/nodejs/node/pull/17031
Refs: https://github.com/nodejs/help/issues/970
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-11-18 20:42:04 +01:00
Anna Henningsen
01f853cde6
zlib: fix decompression of empty data streams
add4b0ab8c made the assumption that compressed data
would never lead to an empty decompressed stream.

Fix that by explicitly checking the number of read bytes.

PR-URL: https://github.com/nodejs/node/pull/17042
Fixes: https://github.com/nodejs/node/issues/17041
Refs: https://github.com/nodejs/node/pull/13322
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-11-18 20:40:27 +01:00
Joyee Cheung
c5b8e168b3
build: enforce order of dependency when building addons
PR-URL: https://github.com/nodejs/node/pull/17048
Fixes: https://github.com/nodejs/node/issues/17043
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-11-18 20:33:31 +01:00
Anatoli Papirovski
4b82d892ab
errors: consistent format for error message
Consistently use printf-style strings for error messages that
do not need a custom argument order or processing of arguments.

PR-URL: https://github.com/nodejs/node/pull/16904
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-11-18 20:27:40 +01:00
Sebastian Silbermann
2c0acc0bc1
doc: explicitly document highWaterMark option
PR-URL: https://github.com/nodejs/node/pull/17049
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-11-18 20:26:39 +01:00
Tobias Nießen
707cd3f615
test: use arrow functions instead of bind
PR-URL: https://github.com/nodejs/node/pull/17070
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Lance Ball <lball@redhat.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
2017-11-18 17:31:46 +01:00
Vse Mozhet Byt
bbd95554c0 doc: fix a link in dgram.md
PR-URL: https://github.com/nodejs/node/pull/17107
Refs: https://en.wikipedia.org/w/index.php?title=IPv6_address&type=revision&diff=809494791&oldid=804196124
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-11-18 14:11:41 +02:00
Benjamin Zaslavsky
45e6642476
console: add support for console.debug
Adds the console.debug() method, alias for console.log(). This method is
exposed by V8 and was only available in inspector until now. Also adds
matching test and documentation.

PR-URL: https://github.com/nodejs/node/pull/17033
Refs: https://github.com/nodejs/node/pull/17004
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-11-18 12:38:59 +01:00
Joyee Cheung
0a1fba02a6
doc: reorganize collaborator guide
* Add sections about first time contributions, code reviews
  and seeking consensus, waiting for approvals, testing and CI
* Move paragraphs to more suitable sections
* Update table of contents
* Document the fast-tracking process

PR-URL: https://github.com/nodejs/node/pull/17056
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2017-11-18 15:38:28 +08:00
Rich Trott
cfda245706 benchmark: use unique filenames in fs benchmarks
Use a unique file name for each benchmark. Running benchmarks
simultaneously may be a bit of an unusual use case, but there are use
cases, such as stress testing `test/parallel/test-benchmark-fs.js`.

PR-URL: https://github.com/nodejs/node/pull/16776
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-11-17 21:08:17 -08:00
Rich Trott
780c2d3917 test: move timing-sensitive test to sequential
test-https-server-keep-alive-timeout relies on server timeouts and
whatnot that will be inherently unreliable on a busy host. The test
fails when run with a high `-j` value and higher `--repeat` value passed
to `tools/test.py`. Move the test to `sequential`.

PR-URL: https://github.com/nodejs/node/pull/16775
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-11-17 21:04:53 -08:00
Rich Trott
02590b4cfa tools: fail tests if malformed status file
PR-URL: https://github.com/nodejs/node/pull/16703
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-11-17 20:56:34 -08:00
Anna Henningsen
ae558af7bc
timers: cross JS/C++ border less frequently
This removes the `process._needImmediateCallback` property
and its semantics of having a 1/0 switch that tells C++ whether
immediates are currently scheduled.

Instead, a counter keeping track of all immediates is created,
that can be increased on `setImmediate()` or decreased when an
immediate is run or cleared.

This is faster, because rather than reading/writing a C++ getter,
this operation can be performed as a direct memory read/write via
a typed array. The only C++ call that is left to make is
activating the native handles upon creation of the first
`Immediate` after the queue is empty.

One other (good!) side-effect is that `immediate._destroyed` now
reliably tells whether an `immediate` is still scheduled to run or not.

Also, as a nice extra, this should make it easier to implement
an internal variant of `setImmediate` for C++ that piggybacks
off the same mechanism, which should be useful at least for
async hooks and HTTP/2.

Benchmark results:

    $ ./node benchmark/compare.js --new ./node --old ./node-master-1b093cb93df0 --runs 10 --filter immediate timers | Rscript benchmark/compare.R
    [00:08:53|% 100| 4/4 files | 20/20 runs | 1/1 configs]: Done
                                                         improvement confidence      p.value
     timers/immediate.js type="breadth" thousands=2000      25.61 %         ** 1.432301e-03
     timers/immediate.js type="breadth1" thousands=2000      7.66 %            1.320233e-01
     timers/immediate.js type="breadth4" thousands=2000      4.61 %            5.669053e-01
     timers/immediate.js type="clear" thousands=2000       311.40 %        *** 3.896291e-07
     timers/immediate.js type="depth" thousands=2000        17.54 %         ** 9.755389e-03
     timers/immediate.js type="depth1" thousands=2000       17.09 %        *** 7.176229e-04
     timers/set-immediate-breadth-args.js millions=5        10.63 %          * 4.250034e-02
     timers/set-immediate-breadth.js millions=10            20.62 %        *** 9.150439e-07
     timers/set-immediate-depth-args.js millions=10         17.97 %        *** 6.819135e-10

PR-URL: https://github.com/nodejs/node/pull/17064
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-11-18 01:50:56 +01:00
Vse Mozhet Byt
ca3f9b7585 doc: delete unused definition in README.md
PR-URL: https://github.com/nodejs/node/pull/17108
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-11-18 00:56:19 +02:00
Rich Trott
6b6474d6c0 doc: add Support section in README
Add a Support section, borrowing heavily from wp-cli project.

Move stuff about contributing to Node.js to the bottom as vastly more
users are interested in using Node.js and getting help with Node.js than
contributing to Node.js. Information still belongs, just not at the top.
(Many people will know to look in CONTRIBUTING.md anyway.)

PR-URL: https://github.com/nodejs/node/pull/16533
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-11-17 13:55:44 -08:00