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

3959 Commits

Author SHA1 Message Date
Vse Mozhet Byt
6763fb2f0e doc: fix some links in http2.md
PR-URL: https://github.com/nodejs/node/pull/15481
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Bryan English <bryan@bryanenglish.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-09-20 22:43:56 +03:00
Vse Mozhet Byt
ee46c73023 doc: fix external links with 404 status
PR-URL: https://github.com/nodejs/node/pull/15463
Fixes: https://github.com/nodejs/node/issues/15462
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-09-20 22:39:13 +03:00
Anna Henningsen
602fd36d95
domain: remove .dispose()
`domain.dispose()` is generally considered an anti-pattern, has been
runtime-deprecated for over 4 years, and is a part of the `domain`
module that can not be emulated by `async_hooks`; so remove it.

Ref: https://nodejs.org/en/docs/guides/domain-postmortem/
Ref: 4a74fc9776

PR-URL: https://github.com/nodejs/node/pull/15412
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2017-09-20 10:45:33 -03:00
Vse Mozhet Byt
3070d53e31
doc: fix new nits in links
PR-URL: https://github.com/nodejs/node/pull/15449
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-09-20 09:09:25 -03:00
Luigi Pinca
784cdad740
doc: add documentation for the 'timeout' event
Adds the `'timeout'` event to the `http.ClientRequest` documentation.

PR-URL: https://github.com/nodejs/node/pull/15443
Fixes: https://github.com/nodejs/node/issues/14856
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-09-20 09:07:01 -03:00
Roga Pria Sembada
873e5bd0b4 crypto: support multiple ECDH curves and auto
Using SSL_CTX_set1_curves_list() (OpenSSL 1.0.2+), this allows to set
colon separated ECDH curve names in SecureContext's ecdhCurve option.
The option can also be set to "auto" to select the curve automatically
from list built in OpenSSL by enabling SSL_CTX_set_ecdh_auto()
(OpenSSL 1.0.2+).

PR-URL: https://github.com/nodejs/node/pull/15206
Ref: https://github.com/nodejs/node/issues/15054
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-09-20 01:16:28 -07:00
Ruben Bridgewater
db2e093e05
assert: handle enumerable symbol keys
PR-URL: https://github.com/nodejs/node/pull/15169
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-09-19 20:13:02 -03:00
Gabriel Schulhof
a8c0a43a22 n-api: remove n-api module loading flag
Remove the command line flag that was needed for N-API module loading.
Re: https://github.com/nodejs/vm/issues/9

PR-URL: https://github.com/nodejs/node/pull/14902
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Hitesh Kanwathirtha <digitalinfinity@gmail.com>
2017-09-19 19:06:44 -04:00
Mani Maghsoudlou
049a8d7c1d
doc: fix entryTypes type and missing link
PR-URL: https://github.com/nodejs/node/pull/15406
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-09-19 16:36:30 -03:00
Bartosz Sosnowski
1ebde6e113
doc: make mkdtemp example work on Windows
PR-URL: https://github.com/nodejs/node/pull/15408
Fixes: https://github.com/nodejs/node/issues/14960
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-09-19 16:32:41 -03:00
Chris Young
2b7b9f24d9
doc: prevent displaying empty version picker
PR-URL: https://github.com/nodejs/node/pull/15420
Fixes: https://github.com/nodejs/node/issues/15396
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-09-19 16:10:19 -03:00
Sampson Gao
19766547fa n-api: add optional string length parameters
PR-URL: https://github.com/nodejs/node/pull/15343
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
2017-09-18 17:47:34 -04:00
James M Snell
c75f87cc4c crypto: refactor the crypto module
* Split single monolithic file into multiple
* Make Certificate methods static
* Allow randomFill(Sync) to use any ArrayBufferView
* Use internal/errors throughout
* Improve arg validation in Hash/Hmac
* Doc updates

PR-URL: https://github.com/nodejs/node/pull/15231
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
2017-09-18 08:10:59 -07:00
Jon Moss
75f7b2f577 doc: do not begin yaml value with backtick
Will break YAML parsing!

See details in the PR.

PR-URL: https://github.com/nodejs/node/pull/15447
Fixes: https://github.com/nodejs/node/issues/14930
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-09-17 19:29:46 +03:00
Ruben Bridgewater
b0d3bec95c
assert: use Same-value equality in deepStrictEqual
PR-URL: https://github.com/nodejs/node/pull/15398
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2017-09-15 23:37:22 -03:00
Antoine AMARA
ca2c73cae0 doc: fix http.ClientRequest method descriptions
fix documentation for methods getHeader, setHeader and removeHeader
for http.ClientRequest class. The documentation said these functions
can be called but they're wasn't describe into the API description yet.

add parameters and general description for each methods.

PR-URL: https://github.com/nodejs/node/pull/15163
Fixes: https://github.com/nodejs/node/issues/15048
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-09-15 15:42:26 -07:00
hisener
a5916107dd doc: fix wrong history entry in deepStrictEqual
PR-URL: https://github.com/nodejs/node/pull/15381
Fixes: https://github.com/nodejs/node/issues/15379
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-09-15 10:21:13 -07:00
Oblosys
8bd1668ca5 doc: fix emitKeypressEvents stream type
PR-URL: https://github.com/nodejs/node/pull/15399
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-09-15 09:40:20 -07:00
James M Snell
d8a0364ad5 async_hooks,doc: some async_hooks improvements
Update docs and type checking for AsyncResource type

PR-URL: https://github.com/nodejs/node/pull/15103
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2017-09-15 09:06:13 -07:00
Jon Moss
e9358af581 errors: remove duplicate error definition
Also fixes error being (now!) properly thrown by alphabetize-errors.

also properly enable lint rule

Was not using proper magic comment syntax before!

-URL: https://github.com/nodejs/node/pull/15307
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-09-14 13:40:18 -07:00
Sampson Gao
973c12f631 n-api: napi_is_construct_call->napi_get_new_target
Remove napi_is_construct_call and introduce napi_get_new_target.

PR-URL: https://github.com/nodejs/node/pull/14698
Reviewed-By: Jason Ginchereau <jasongin@microsoft.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Kyle Farnung <kfarnung@microsoft.com>
2017-09-14 16:21:27 -04:00
Jason Ginchereau
0c258bdc40 n-api: Context for custom async operations
- Add napi_async_context opaque pointer type.
   (If needed, we could later add APIs for getting the async IDs
   out of this context.)
 - Add napi_async_init() and napi_async_destroy() APIs.
 - Add async_context parameter to napi_make_callback().
 - Add code and checks to test_make_callback to validate async context
   APIs by checking async hooks are called with correct context.
 - Update API documentation.

PR-URL: https://github.com/nodejs/node/pull/15189
Fixes: https://github.com/nodejs/node/issues/13254
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-09-14 16:05:46 -04:00
Taylor Woll
92e5f5cc09 n-api: refactor napi_addon_register_func
As per discussion in abi-stable-node:
https://github.com/nodejs/abi-stable-node/issues/256,
take a refactor to napi_addon_register_func such that
the result from the register function is assigned to
the module exports property. By making this change,
native module can be agnostic about which type of
module the environment supports.

PR-URL: https://github.com/nodejs/node/pull/15088
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Hitesh Kanwathirtha <digitalinfinity@gmail.com>
2017-09-14 15:02:10 -04:00
Jason Ginchereau
1a0727d85e
n-api: change async resource name to napi_value
PR-URL: https://github.com/nodejs/node/pull/14697
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-09-14 17:39:05 +02:00
Anna Henningsen
8c8c90b714
n-api: use AsyncResource for Work tracking
Enable combining N-API async work with async-hooks.

PR-URL: https://github.com/nodejs/node/pull/14697
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jason Ginchereau <jasongin@microsoft.com>
Reviewed-By: Michael Dawson <mhdawson@ibm.com>
2017-09-14 17:38:45 +02:00
Will Young
4ae0afb12b dgram: added setMulticastInterface()
Add wrapper for uv's uv_udp_set_multicast_interface which provides the
sender side mechanism to explicitly select an interface. The
equivalent receiver side mechanism is the optional 2nd argument of
addMembership().

PR-URL: https://github.com/nodejs/node/pull/7855
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2017-09-14 17:03:19 +02:00
Myles Borins
cba206fa24
docs: update 8.5.0 changelog
The original changelog included incorrect information regarding
the new perf_hooks api.

refs: https://github.com/nodejs/node/pull/15308#issuecomment-328874385

PR-URL: https://github.com/nodejs/node/pull/15384
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-09-14 13:45:08 +02:00
Alex Gresnel
ed2f347f27
child_process: set shell to false in fork()
This commit ensures that spawn()'s shell option is unconditionally
set to false when fork() is called.

Refs: https://github.com/nodejs/node/pull/15299
Fixes: https://github.com/nodejs/node/issues/13983
PR-URL: https://github.com/nodejs/node/pull/15352
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-09-13 21:03:39 -04:00
Rich Trott
d38e643409
test: remove obsolete debugger tests
The tests in `test/debugger` all fail since the removal of the
pre-inspector debugger (if they weren't already failing). They do not
run in CI (probably because they were never reliable). Remove them and
associated fixtures.

PR-URL: https://github.com/nodejs/node/pull/15139
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-09-13 17:58:38 -03:00
Rich Trott
ff16337b80
doc: use consistent terminology in process doc
`process.md` uses `POSIX` in most places, but `Unix` (and in one case
`Linux`) in a handful of cases where `POSIX` is appropriate. Change
those instances to `POSIX`.

PR-URL: https://github.com/nodejs/node/pull/15321
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-09-13 17:16:25 -03:00
Michaël Zasso
99a779947c
doc: add missing doc for readable._destroy
PR-URL: https://github.com/nodejs/node/pull/15316
Fixes: https://github.com/nodejs/node/issues/15291
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-09-13 17:04:10 -03:00
XadillaX
468110b327
tls: deprecate parseCertString & move to internal
`tls.parseCertString()` exposed by accident. Now move this function to
`internal/tls` and mark the original one as deprecated.

PR-URL: https://github.com/nodejs/node/pull/14249
Refs: https://github.com/nodejs/node/issues/14193
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2017-09-13 16:54:35 -03:00
Jon Moss
f68ab39f8e
doc: add missing heading for error
PR-URL: https://github.com/nodejs/node/pull/15325
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-09-13 16:46:17 -03:00
Tuan Anh Tran
0dad97cdec doc: fix "added in" for Buffer.allocUnsafeSlow()
PR-URL: https://github.com/nodejs/node/pull/15330
Fixes: https://github.com/nodejs/node/issues/15279
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-09-13 18:54:54 +03:00
Damien O'Reilly
2ac7b433b4
dgram: support for setting socket buffer size
* setRecvBufferSize(int) and setSendBufferSize(int)
* added docs for send/receive buffer sizes
* Added options support to set buffer sizes in
  dgram.createSocket().

PR-URL: https://github.com/nodejs/node/pull/13623
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-09-13 11:23:04 -04:00
Vse Mozhet Byt
b4b7ac6ae8 doc: fix nits in esm.md
* Fix some abbreviated wording, a typo and a link.
* Wrap long lines at 80 characters.

PR-URL: https://github.com/nodejs/node/pull/15315
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-09-13 16:57:05 +03:00
Gabriel Schulhof
cb94905774 n-api: stop creating references to primitives
The binding testing napi_wrap() creates references to primitives passed
into the binding in its second parameter. This is unnecessary and not
at all the point of the test. Additionally, creating persistent
references to primitive values may not be supported by all VMs, since
primitives are best persisted in their native form.

Instead, the point of the test is to make sure that the finalize
callback gets called when it should get called, that it gets called
with the correct pointer, and that it does not get called when it
should not get called. Creating persistent references is not necessary
for verifying this.

PR-URL: https://github.com/nodejs/node/pull/15289
Reviewed-By: Jason Ginchereau <jasongin@microsoft.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Re: https://github.com/nodejs/node-chakracore/issues/380
2017-09-13 06:19:50 +03:00
Ruben Bridgewater
22ae8c0248
assert: fix boxed primitives in deepStrictEqual
Unbox all primitives and compare them as well instead of
only comparing boxed strings.

PR-URL: https://github.com/nodejs/node/pull/15050
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-09-12 17:29:37 -03:00
geek
e13d1df89b
assert: support custom errors
This commit adds special handling of Error instances when passed
as the message argument to assert functions. With this commit,
if an Error is passed as the message, then that Error is thrown
instead of an AssertionError.

PR-URL: https://github.com/nodejs/node/pull/15304
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-09-12 15:02:00 -04:00
Myles Borins
a10856a7d3
2017-09-12, Version 8.5.0 (Current)
Notable Changes

* build:
  * Snapshots are now re-enabled in V8
  https://github.com/nodejs/node/pull/14875

* console:
  * Implement minimal `console.group()`.
  https://github.com/nodejs/node/pull/14910

* deps:
  * upgrade libuv to 1.14.1
    https://github.com/nodejs/node/pull/14866
  * update nghttp2 to v1.25.0
    https://github.com/nodejs/node/pull/14955

* dns:
  * Add `verbatim` option to dns.lookup(). When true, results from the
    DNS resolver are passed on as-is, without the reshuffling that
    Node.js otherwise does that puts IPv4 addresses before IPv6
    addresses.
    https://github.com/nodejs/node/pull/14731

* fs:
  * add fs.copyFile and fs.copyFileSync which allows for more efficient
    copying of files.
    https://github.com/nodejs/node/pull/15034

* inspector:
  * Enable async stack traces
    https://github.com/nodejs/node/pull/13870

* module:
  * Add support for ESM. This is currently behind the
    `--experimental-modules` flag and requires the .mjs extension.
    `node --experimental-modules index.mjs`
    https://github.com/nodejs/node/pull/14369

* napi:
  * implement promise
    https://github.com/nodejs/node/pull/14365

* os:
  * Add support for CIDR notation to the output of the
    networkInterfaces() method.
    https://github.com/nodejs/node/pull/14307

* perf_hooks:
  * An initial implementation of the Performance Timing API for
    Node.js. This is the same Performance Timing API implemented by
    modern browsers with a number of Node.js specific properties. The
    User Timing mark() and measure() APIs are implemented, as is a
    Node.js specific flavor of the Frame Timing for measuring event
    loop duration.
    https://github.com/nodejs/node/pull/14680

* tls:
  * multiple PFX in createSecureContext
    [#14793](https://github.com/nodejs/node/pull/14793)

* Added new collaborators:
  * BridgeAR – Ruben Bridgewater

PR-URL: https://github.com/nodejs/node/pull/15308
2017-09-12 17:34:51 +02:00
Vse Mozhet Byt
da057dbf8f doc: fix some internal links
PR-URL: https://github.com/nodejs/node/pull/15293
Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-09-12 17:03:30 +03:00
David Benjamin
6ebdb69472
crypto: fix Node_SignFinal
PR #11705 switched Node away from using using OpenSSL's legacy EVP_Sign*
and EVP_Verify* APIs. Instead, it computes a hash normally via
EVP_Digest* and then uses EVP_PKEY_sign and EVP_PKEY_verify to verify
the hash directly. This change corrects two problems:

1. The documentation still recommends the signature algorithm EVP_MD
   names of OpenSSL's legacy APIs. OpenSSL has since moved away from
   thosee, which is why ECDSA was strangely inconsistent. (This is why
   "ecdsa-with-SHA256" was missing.)

2. Node_SignFinal copied some code from EVP_SignFinal's internals. This
   is problematic for OpenSSL 1.1.0 and is missing a critical check
   that prevents pkey->pkey.ptr from being cast to the wrong type.

To resolve this, remove the non-EVP_PKEY_sign codepath. This codepath is
no longer necessary. PR #11705's verify half was already assuming all
EVP_PKEYs supported EVP_PKEY_sign and EVP_PKEY_verify. Also, in the
documentation, point users towards using hash function names which are
more consisent. This avoids an ECDSA special-case and some strangeness
around RSA-PSS ("RSA-SHA256" is the OpenSSL name of the
sha256WithRSAEncryption OID which is not used for RSA-PSS).

PR-URL: https://github.com/nodejs/node/pull/15024
Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-09-11 00:18:02 -03:00
Ben Noordhuis
668ad44922
intl: unexpose Intl.v8BreakIterator
It was never an official Ecma-402 API, it is about to be superseded
by `Intl.Segmenter` and it's prone to crash under some circumstances.

Searches don't turn up any usage in the wild and the recommendation
from the V8 team is to remove it.  Now seems like a good a time as
any to do that.

Fixes: https://github.com/nodejs/node/issues/8865
Fixes: https://github.com/nodejs/node/issues/14909
Refs: https://github.com/tc39/proposal-intl-segmenter
Refs: https://chromium-review.googlesource.com/c/v8/v8/+/620755
PR-URL: https://github.com/nodejs/node/pull/15238
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-09-10 22:00:25 +02:00
Gabriel Schulhof
61e9ba1271 n-api: implement napi_run_script
Fixes: https://github.com/nodejs/abi-stable-node/issues/51
PR-URL: https://github.com/nodejs/node/pull/15216
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com
Reviewed-By: James M Snell <jasnell.gmail.com>
Reviewed-By: Michael Dawson <mhdawson@ca.ibm.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-09-10 02:13:29 +03:00
Gabriel Schulhof
78286984da test,doc: make module name match gyp target name
Currently the nm_modname does not match the file name of the resulting
module. In fact, the nm_modname is pretty arbitrary. This seeks to
introduce some consistency into the nm_modname property by having the
name of the module appear in exactly one place: the "target_name"
property of the gyp target that builds the module.

PR-URL: https://github.com/nodejs/node/pull/15209
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-09-10 00:15:49 +03:00
Sam Roberts
c14ca4925a
doc: fix Error property markdown level
Properties should be documented at same level as their constructor, as
they are in the other API doc sections.

PR-URL: https://github.com/nodejs/node/pull/15247
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-09-09 16:44:58 -03:00
Ezequiel Garcia
5f22375922
src: add support to pass flags to dlopen
* add constants for dlopen flags, which are needed
  for dlopen's flag passing.

* introduce an optional parameter for process.dlopen(),
  allowing to pass dlopen flags (using values from os.constants.dlopen).

If no flags are passed, the default behavior is to load the library
with RTLD_LAZY (perform lazy binding) and RTLD_LOCAL (symbols are
available only locally).

PR-URL: https://github.com/nodejs/node/pull/12794
Refs: https://github.com/nodejs/node/pull/4105
Refs: https://github.com/libuv/libuv/pull/1331
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2017-09-08 17:14:03 -04:00
cjihrig
11b7428832
fs: add fs.copyFile{Sync}
Fixes: https://github.com/nodejs/node/issues/14906
PR-URL: https://github.com/nodejs/node/pull/15034
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-09-08 00:08:04 -04:00
Vse Mozhet Byt
6281361504 doc: add ESM doc to _toc.md and all.md
PR-URL: https://github.com/nodejs/node/pull/15248
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-09-08 06:34:47 +03:00
XadillaX
703a3b5388
doc, tls: mark parseCertString() as deprecated
`tls.parseCertString()` was made public by mistack. So mark it as
deprecated.

PR-URL: https://github.com/nodejs/node/pull/14245
Refs: https://github.com/nodejs/node/issues/14193
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-09-07 23:34:10 -03:00
Jessica Quynh Tran
89f207499a
doc: document bytes to chars after setEncoding
This commit documents and edge-case behavior in readable streams.
It is expected that non-object streams are measured in bytes
against the highWaterMark. However, it was discovered in issue
thereafter begin to measure the buffer's length in characters.

PR-URL: https://github.com/nodejs/node/pull/13442
Refs: https://github.com/nodejs/node/issues/6798
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-09-07 23:22:12 -03:00
George Bezerra
1cdb41f287
doc: document missing error codes
There are discrepancies between the errors defined in
`lib/internal/errors.js` and those documented in `doc/api/errors.md`.
Some of the errors recently defined are not documented, while others
were removed, but still have entries in the docs. This commit fills in
those gaps in the documentation.

PR-URL: https://github.com/nodejs/node/pull/15160
Fixes: https://github.com/nodejs/node/issues/15038
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-09-07 22:01:02 -03:00
Yury Popov
372dc86af5
tls: multiple PFX in createSecureContext
Add support for multiple PFX files in tls.createSecureContext.
Also added support for object-style PFX pass.

PR-URL: https://github.com/nodejs/node/pull/14793
Fixes: https://github.com/nodejs/node/issues/14756
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-09-07 21:48:46 -03:00
Bradley Farias
c8a389e19f module: Allow runMain to be ESM
This follows the EPS an allows the node CLI to have ESM as an entry point.
`node ./example.mjs`. A newer V8 is needed for `import()` so that is not
included. `import.meta` is still in specification stage so that also is not
included.

PR-URL: https://github.com/nodejs/node/pull/14369
Author: Bradley Farias <bradley.meck@gmail.com>
Author: Guy Bedford <guybedford@gmail.com>
Author: Jan Krems <jan.krems@groupon.com>
Author: Timothy Gu <timothygu99@gmail.com>
Author: Michaël Zasso <targos@protonmail.com>
Author: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2017-09-07 15:18:32 -05:00
Adina Shanholtz
447715543b doc: add options argument to crypto docs
PR-URL: https://github.com/nodejs/node/pull/14846
Fixes: https://github.com/nodejs/node/issues/14804
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2017-09-07 13:13:24 +02:00
Myles Borins
dc7f03c897
2017-09-05, Version 6.11.3 'Boron' (LTS)
This LTS release comes with 152 commits. This includes 75 which are
test related, 25 which are doc related, 21 which are build / tool
related and 3 commits which are updates to dependencies.

Notable Changes:

* build:
 - Codesigning is fixed on macOS (Evan Lucas)
   https://github.com/nodejs/node/pull/14179
* deps:
 - Snapshots are turned back on!!! (Yang Guo)
   https://github.com/nodejs/node/pull/14385
* path:
 - win32 volume-relative paths are working again! (Timothy Gu)
   https://github.com/nodejs/node/pull/14440
* tools:
 - v6.x can now build with ICU 59 (Steven R. Loomis)
   https://github.com/nodejs/node/pull/12078

PR-URL: https://github.com/nodejs/node/pull/14852
2017-09-05 15:47:35 -04:00
Rich Trott
a25c754e42 doc: clarify async/asynchronous in deprecations.md
Change _async_ to _asynchronous_ in `deprecations.md` to avoid confusion
with the `async` keyword. This has the additional minor benefit of being
more formal and less conversational prose.

PR-URL: https://github.com/nodejs/node/pull/15172
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-09-05 12:38:40 -07:00
Ruben Bridgewater
ea2e6363f2
assert: use SameValueZero in deepStrictEqual
Comparing NaN will not throw anymore.

PR-URL: https://github.com/nodejs/node/pull/15036
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2017-09-05 08:15:33 -03:00
Ruben Bridgewater
1789dcfc87
doc: add missing changelogs to assert docs
PR-URL: https://github.com/nodejs/node/pull/15036
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2017-09-05 08:12:38 -03:00
Eduard Bondarenko
b24e269a48 net: multiple listen() events fail silently
Problem:
It's possible to run listen()
  on a net.Server that's already listening to a port.
The result is silent failure,
  with the side effect of changing the connectionKey and or pipeName.

Solution:
  throw an error if listen method called more than once.
  close() method should be called between listen() method calls.

Refs: https://github.com/nodejs/node/pull/8294
Fixes: https://github.com/nodejs/node/issues/6190
Fixes: https://github.com/nodejs/node/issues/11685
PR-URL: https://github.com/nodejs/node/pull/13149
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-09-04 12:41:54 +02:00
Piotr Mionskowski
ec599b87ae
doc: readFileSync instead of fs.readFileSync
The ALPN negotiation sample uses `fs.readFileSync` whereas
`readFileSync` is imported into top level variable.

PR-URL: https://github.com/nodejs/node/pull/15137
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-09-01 17:14:21 -04:00
Anna Henningsen
dd52cad044 doc,lib,src,test: strip executable bits off files
Remove the executable bits of the file modes of some files that
accidentally received it.

PR-URL: https://github.com/nodejs/node/pull/15132
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-09-01 10:09:41 -07:00
Ruben Bridgewater
204d94fc75
assert: handle errors properly with deep*Equal
PR-URL: https://github.com/nodejs/node/pull/15001
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-09-01 02:00:15 -03:00
matzavinos
219932a9f7
errors: convert 'fs'
covert lib/fs.js over to using lib/internal/errors.js
i have not addressed the cases that use errnoException(),
for reasons described in GH-12926

- throw the ERR_INVALID_CALLBACK error
  when the the callback is invalid
- replace the ['object', 'string'] with
  ['string', 'object'] in the error constructor call,
  to better match the previous err msg
  in the getOptions() function
- add error ERR_VALUE_OUT_OF_RANGE in lib/internal/errors.js,
  this error is thrown when a numeric value is out of range
- document the ERR_VALUE_OUT_OF_RANGE err in errors.md
- correct the expected args, in the error thrown in the function
  fs._toUnixTimestamp() to ['Date', 'time in seconds'] (lib/fs.js)
- update the listener error type in the fs.watchFile() function,
  from Error to TypeError (lib/fs.js)
- update errors from ERR_INVALID_OPT_VALUE to ERR_INVALID_ARG_TYPE
  in the functions fs.ReadStream() and fs.WriteStream(),
  for the cases of range errors use the new error:
  ERR_VALUE_OUT_OF_RANGE (lib/fs.js)

PR-URL: https://github.com/nodejs/node/pull/15043
Refs: https://github.com/nodejs/node/issues/11273
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-08-31 19:37:39 -04:00
Roman Reiss
a517466aa7
module: mark DEP0019 as EOL and remove compat code
This removes the compatibilty code that was in place to allow an unintended
interaction between `require('.')` and `NODE_PATH`. The compatibility code and
the accompanying deprecation warning has been in place since 2015-04-17.

PR-URL: https://github.com/nodejs/node/pull/3384
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-08-31 21:11:49 +02:00
Chris Young
c77e6d3f8c n-api: adds function to adjust external memory
Added a wrapper around
v8::Isolate::AdjustAmountOfExternalAllocatedMemory

PR-URL: https://github.com/nodejs/node/pull/14310
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Fixes: https://github.com/nodejs/node/issues/13928
2017-08-30 22:27:11 +03:00
creeperyang
4218afce9a doc: fix comment about http2.createSecureServer
PR-URL: https://github.com/nodejs/node/pull/15085
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-30 12:21:14 -07:00
Anatoli Papirovski
ad3d2ce68a http2: handle 100-continue flow & writeContinue
Adds an implementation for writeContinue based on the h2 spec & the
existing http implementation. ClientHttp2Stream now also emits
a continue event when it receives headers with :status 100.
Includes two test cases for default server continue behaviour and
for the exposed checkContinue listener.

PR-URL: https://github.com/nodejs/node/pull/15039
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-30 12:00:49 -07:00
Jan Schär
a80b1621b0 doc: remove braces which shouldn't be there
PR-URL: https://github.com/nodejs/node/pull/15094
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-30 09:35:24 -07:00
AJ Jordan
13927fd931 doc: clarify http.get data consumption requirement
With the previous wording, I read this sentence as meaning, "you
_must_ use the http.get callback mechanism and cannot register a
listener on the returned http.ClientRequest object." This is obviously
not the intention, so adjust the sentence to make this clearer.

PR-URL: https://github.com/nodejs/node/pull/15049
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-29 10:59:18 -07:00
James M Snell
f3eb193a30 meta: merge TSC and CTC back into a single body
PR-URL: https://github.com/nodejs/node/pull/14973
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
2017-08-29 08:39:25 -07:00
Chris Young
cacce304cb doc: add links to alternative versions of doc
Each page of the API documentation should have links to other versions
of the same page. This will make it easier to switch between the current
"live" release at nodejs.org and LTS versions.

PR-URL: https://github.com/nodejs/node/pull/10958
Fixes: https://github.com/nodejs/node/issues/10726
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-08-28 11:17:08 +02:00
Matteo Collina
53c5bf546e http2: refactor error handling
This changes the error handling model of ServerHttp2Stream,
ServerHttp2Request and ServerHttp2Response.
An 'error' emitted on ServerHttp2Stream will not go to
'uncaughtException' anymore, but to the server 'streamError'.
On the stream 'error', ServerHttp2Request will emit 'abort', while
ServerHttp2Response would do nothing.
It also updates respondWith* to the new error handling.

Fixes: https://github.com/nodejs/node/issues/14963
PR-URL: https://github.com/nodejs/node/pull/14991
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2017-08-28 00:39:42 +04:00
Weijia Wang
4d893e093a
timers: Migrate to use internal/errors
PR-URL: https://github.com/nodejs/node/pull/14659
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-08-27 11:14:50 -03:00
Rich Trott
f912080bf2 Revert "http2: refactor error handling"
This reverts commit 4ca8ff264f.

That commit was landed without a green CI and is failing on Windows.

PR-URL: https://github.com/nodejs/node/pull/15047
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-26 13:13:17 -07:00
James M Snell
6db825ae82 perf_hooks: mark as experimental
PR-URL: https://github.com/nodejs/node/pull/14997
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2017-08-25 16:04:21 -07:00
Matteo Collina
4ca8ff264f http2: refactor error handling
This changes the error handling model of ServerHttp2Stream,
ServerHttp2Request and ServerHttp2Response.
An 'error' emitted on ServerHttp2Stream will not go to
'uncaughtException' anymore, but to the server 'streamError'.
On the stream 'error', ServerHttp2Request will emit 'abort', while
ServerHttp2Response would do nothing

See: https://github.com/nodejs/node/issues/14963

PR-URL: https://github.com/nodejs/node/pull/14991
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2017-08-25 14:28:54 -07:00
Jan Schär
8987ae843e doc,stream: remove wrong remark on readable.read
The returned chunk is *never* longer than `size`.

PR-URL: https://github.com/nodejs/node/pull/15014
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-08-25 13:26:36 -07:00
Sam Roberts
a1d34b3f49 doc: threadpool size, and APIs using the pool
Not knowing which APIs use libuv's threadpool can lead to surprising
performance problems. Document the APIs, and also document
UV_THREADPOOL_SIZE, which can be used to fix problems.

PR-URL: https://github.com/nodejs/node/pull/14995
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-25 10:16:00 -07:00
Sam Roberts
6cdffb18c5 doc: sort bottom-of-file dns markdown links
PR-URL: https://github.com/nodejs/node/pull/14992
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-08-25 10:09:47 -07:00
Sam Roberts
68321b5cb0 doc: crypto.randomBytes does not block when async
It may not return random bytes right away, but when called
asynchronously it will not block.

PR-URL: https://github.com/nodejs/node/pull/14993
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-08-25 10:06:02 -07:00
Gabriel Schulhof
7efb8f7619 n-api: implement promise
Promise is implemented as a pair of objects. `napi_create_promise()`
returns both a JavaScript promise and a newly allocated "deferred" in
its out-params. The deferred is linked to the promise such that the
deferred can be passed to `napi_resolve_deferred()` or
`napi_reject_deferred()` to reject/resolve the promise.

`napi_is_promise()` can be used to check if a `napi_value` is a native
promise - that is, a promise created by the underlying engine, rather
than a pure JS implementation of a promise.

PR-URL: https://github.com/nodejs/node/pull/14365
Fixes: https://github.com/nodejs/abi-stable-node/issues/242
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-08-25 12:02:55 +03:00
Rod Vagg
be4c984747 doc: environmental->environment & NodeJS->Node.js
PR-URL: https://github.com/nodejs/node/pull/14974
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-24 15:17:29 -07:00
Michał Wadas
abced13e29 doc: fix typo in Buffer.from(string, [encoding])
PR-URL: https://github.com/nodejs/node/pull/15013
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-08-25 00:19:35 +08:00
Rich Trott
c40229a9b8 console: implement minimal console.group()
Node.js exposes `console.group()` and `console.groupEnd()` via the
inspector. These functions have no apparent effect when called from
Node.js without the inspector. We cannot easily hide them when Node.js
is started without the inspector because we support opening the
inspector during runtime via `inspector.port()`.

Implement a minimal `console.group()`/`console.groupEnd()`. More
sophisticated implementations are possible, but they can be done in
userland and/or features can be added to this at a later time.

`console.groupCollapsed()` is implemented as an alias for
`console.group()`.

PR-URL: https://github.com/nodejs/node/pull/14910
Fixes: https://github.com/nodejs/node/issues/1716
Ref: https://github.com/nodejs/node/issues/12675
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-08-23 18:46:14 -07:00
James M Snell
67269fd7f3 perf_hooks: implementation of the perf timing API
An initial implementation of the Performance Timing API for Node.js.
This is the same Performance Timing API implemented by modern browsers
with a number of Node.js specific properties. The User Timing mark()
and measure() APIs are implemented, garbage collection timing, and
node startup milestone timing.

```js
const { performance } = require('perf_hooks');

performance.mark('A');
setTimeout(() => {
  performance.mark('B');
  performance.measure('A to B', 'A', 'B');
  const entry = performance.getEntriesByName('A to B', 'measure')[0];
  console.log(entry.duration);
}, 10000);
```

The implementation is at the native layer and makes use of uv_hrtime().
This should enable *eventual* integration with things like Tracing
and Inspection.

The implementation is extensible and should allow us to add new
performance entry types as we go (e.g. for measuring i/o perf,
etc).

Documentation and a test are provided.

PR-URL: https://github.com/nodejs/node/pull/14680
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2017-08-23 16:00:09 -07:00
Ben Noordhuis
e007f66ae2 dns: add verbatim option to dns.lookup()
When true, results from the DNS resolver are passed on as-is, without
the reshuffling that Node.js otherwise does that puts IPv4 addresses
before IPv6 addresses.

PR-URL: https://github.com/nodejs/node/pull/14731
Ref: https://github.com/nodejs/node/issues/6307
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-23 14:53:47 -07:00
hafiz
e76b1ff17e doc: rephrase text of child_process.execSync()
Rephrases the error thrown by child_process.execSync().

PR-URL: https://github.com/nodejs/node/pull/14953
Fixes: https://github.com/nodejs/node/issues/14944
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-08-23 10:21:02 -07:00
sevenryze
c19894f814 doc: beautify net.md formats
PR-URL: https://github.com/nodejs/node/pull/14987
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-23 09:10:05 -07:00
James Kyle
954b346e5a doc: link to correct "OS Constants" heading in docs
PR-URL: https://github.com/nodejs/node/pull/14969
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-08-23 08:07:31 -07:00
RefinedSoftwareLLC
d70d36b3b2
doc: update http2.md example code
`require('http');` should be `require('http2');`

PR-URL: https://github.com/nodejs/node/pull/14979
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-08-22 17:45:29 -04:00
Daniel Taveras
82bad0b4d8 doc: fix doc for napi_get_value_string_utf8
The API for napi_get_value_string_utf8() appears to have been
previously changed. This improves the doc reflect the current design.

PR-URL: https://github.com/nodejs/node/pull/14529
Fixes: https://github.com/nodejs/node/issues/14398
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-08-22 17:39:31 -04:00
Shigeki Ohtsu
9dfb2d14cb crypto: warn if counter mode used in createCipher
`crypto.createCipher()` sets the fixed IV derived from password and it
leads to a security risk of nonce reuse when counter mode is used.
A warning is emitted when CTR, GCM or CCM is used in
`crypto.createCipher()` to notify users to avoid nonce reuse.

Fixes: https://github.com/nodejs/node/issues/13801
PR-URL: https://github.com/nodejs/node/pull/13821
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-08-22 21:23:38 +09:00
Gabriel Schulhof
70664bf5a1 n-api: add ability to remove a wrapping
Calling napi_wrap() twice on the same object has the result of returning
napi_invalid_arg on the second call. However, sometimes it is necessary
to replace the native pointer associated with a given object. This new
API allows one to remove an existing pointer, returning the object to
its pristine, non-wrapped state.

PR-URL: https://github.com/nodejs/node/pull/14658
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Fixes: https://github.com/nodejs/abi-stable-node/issues/266
2017-08-22 12:31:22 +03:00
sharababy
f0d8eb644f doc: fixed link definitions in http2.md footer
PR-URL: https://github.com/nodejs/node/pull/14946
Fixes: https://github.com/nodejs/node/issues/14857
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-21 14:44:09 -07:00
James M Snell
1524458c54 doc: remove you and fixup note in stream.md
PR-URL: https://github.com/nodejs/node/pull/14938
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-08-21 11:17:50 -07:00
Anand Suresh
39dd230366
doc: minor fixes to http/2 docs
PR-URL: https://github.com/nodejs/node/pull/14877
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-08-21 01:37:51 +02:00
Aleh Zasypkin
e96c11c384
doc,fs: rename defaultEncoding option to encoding
The documentation for `fs.createWriteStream()` references a
`defaultEncoding` as possible options property, but in reality
`encoding` property is expected and properly handled. This fix updates
the documentation to rename the `defaultEncoding` property to
`encoding`.

PR-URL: https://github.com/nodejs/node/pull/14867
Fixes: https://github.com/nodejs/node/issues/14611
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-20 18:03:51 -04:00
George Sapkin
4cff2cc20f doc: remove redundant only from doc/api/stream.md
PR-URL: https://github.com/nodejs/node/pull/14858
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-20 11:05:13 +02:00
陈刚
4d842e3d66 doc: fix http api document
PR-URL: https://github.com/nodejs/node/pull/14625
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2017-08-18 17:12:04 +03:00
hsmtkk
472a8a7f8d
doc: fix typo in cli.md
PR-URL: https://github.com/nodejs/node/pull/14855
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Roman Reiss <me@silverwind.io>
2017-08-16 18:14:13 +02:00
Kyle Farnung
e96b94970a doc: added napi_get_value_string_latin1
* Reordered string functions alphabetically
* Fixed a typo in napi_get_value_string_utf8

PR-URL: https://github.com/nodejs/node/pull/14678
Fixes: https://github.com/nodejs/node/issues/14397
Refs: https://github.com/nodejs/node/issues/14256
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-08-16 12:16:45 +02:00
Saad Quadri
eab2bea46f doc: fix word wrapping for api stability boxes
PR-URL: https://github.com/nodejs/node/pull/14809
Fixes: https://github.com/nodejs/nodejs.org/issues/1337
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-08-16 11:49:55 +02:00
James M Snell
eac0147085 tools: checkout for unassigned DEP00XX codes
Check for `DEP00XX` codes on release build like we do with `REPLACEME`

PR-URL: https://github.com/nodejs/node/pull/14702
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-08-16 00:04:03 -07:00
Anna Henningsen
1fe0741e50 2017-08-15, Version 8.4.0 (Current)
Notable changes

* **HTTP2**
  * Experimental support for the built-in `http2` has been added via the
    `--expose-http2` flag.
    [#14239](https://github.com/nodejs/node/pull/14239)

* **Inspector**
  * `require()` is available in the inspector console now.
    [#8837](https://github.com/nodejs/node/pull/8837)
  * Multiple contexts, as created by the `vm` module, are supported now.
    [#14465](https://github.com/nodejs/node/pull/14465)

* **N-API**
  * New APIs for creating number values have been introduced.
    [#14573](https://github.com/nodejs/node/pull/14573)

* **Stream**
  * For `Duplex` streams, the high water mark option can now be set
    independently for the readable and the writable side.
    [#14636](https://github.com/nodejs/node/pull/14636)

* **Util**
  * `util.format` now supports the `%o` and `%O` specifiers for printing
    objects.
    [#14558](https://github.com/nodejs/node/pull/14558)

PR-URL: https://github.com/nodejs/node/pull/14811
2017-08-15 15:05:22 -05:00
Weijia Wang
11a2ca29ba
errors: migrate _http_outgoing
PR-URL: https://github.com/nodejs/node/pull/14735
Refs: https://github.com/nodejs/node/issues/11273
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-08-14 17:19:19 -04:00
Mudit Ameta
4a6b678070
os: add CIDR support
This patch adds support for CIDR notation to the output of the
`networkInterfaces()` method

PR-URL: https://github.com/nodejs/node/pull/14307
Fixes: https://github.com/nodejs/node/issues/14006
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-08-14 15:43:10 -04:00
Refael Ackermann
85d7d97d81
doc: delint
PR-URL: https://github.com/nodejs/node/pull/14707
Refs: https://github.com/nodejs/node/pull/12756
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2017-08-14 08:13:07 -04:00
Refael Ackermann
6d84e30087
doc: fix header level typo
PR-URL: https://github.com/nodejs/node/pull/14707
Refs: https://github.com/nodejs/node/pull/12756
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2017-08-14 08:13:07 -04:00
Anna Henningsen
314217f8fb
doc: add missing changes: metadata for util
Ref: https://github.com/nodejs/node/pull/14558
PR-URL: https://github.com/nodejs/node/pull/14810
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2017-08-13 22:21:03 +02:00
Anna Henningsen
7e0c2ea92b
doc: add missing changes: metadata for streams
Ref: https://github.com/nodejs/node/pull/14636
PR-URL: https://github.com/nodejs/node/pull/14810
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2017-08-13 22:20:44 +02:00
Gabriel Schulhof
6fe72c82d2 src: mention that node options are space-separated
The documentation does not mention that the value of NODE_OPTIONS is a
space-separated list.

PR-URL: https://github.com/nodejs/node/pull/14709
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-08-13 21:21:39 +03:00
Daijiro Wachi
7294f57c0d doc: fix docs style in util.md
Summary
  + L582: Cell should be padded
  + L589: Cell should be padded
  + L590: Cell should be padded
  + L600: Cell should be padded
  + L622: Cell should be padded

PR-URL: https://github.com/nodejs/node/pull/14711
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-08-13 20:19:12 +02:00
Daijiro Wachi
003ba0b0e2 doc: fix docs style in intl.md
Summary
  + L43: Add missing final pipe in table fence
  + L45: Add missing final pipe in table fence
  + L46: Add missing final pipe in table fence
  + L47: Add missing final pipe in table fence
  + L48: Add missing final pipe in table fence
  + L49: Add missing final pipe in table fence
  + L50: Add missing final pipe in table fence
  + L51: Add missing final pipe in table fence
  + L52: Add missing final pipe in table fence
  + L53: Add missing final pipe in table fence
  + L54: Add missing final pipe in table fence
  + L55: Add missing final pipe in table fence

PR-URL: https://github.com/nodejs/node/pull/14711
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-08-13 20:18:50 +02:00
Vishal Bisht
89d9cc789b
doc: expanded description of buffer.slice
Added description for the case when `end` is greater than buffer length

PR-URL: https://github.com/nodejs/node/pull/14720
Fixes: https://github.com/nodejs/node/issues/14714
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-08-12 16:16:46 -04:00
Anna Henningsen
835c383969
n-api: add napi_get_node_version
Add `napi_get_node_version`, to help with feature-detecting
Node.js as an environment.

PR-URL: https://github.com/nodejs/node/pull/14696
Reviewed-By: Kyle Farnung <kfarnung@microsoft.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-08-12 21:28:59 +02:00
Keita Akutsu
0eb7268451
doc: fix http2 sample code for http2.md
PR-URL: https://github.com/nodejs/node/pull/14667
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-08-10 17:41:50 +02:00
Gil Tayar
52a0d97187
doc: explain browser support of http/2 without SSL
Since browser support HTTP/2 only using SSL, the basic example
given in the docs won't work if the client is a browser.

Added a note to documentation explaining this and how to change
the code to make browser support it.

PR-URL: https://github.com/nodejs/node/pull/14670
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2017-08-10 17:40:12 +02:00
Mandeep Singh
4796fbc7d8 doc: add docs for AssertionError
Fixes: https://github.com/nodejs/node/issues/12274
PR-URL: https://github.com/nodejs/node/pull/14261
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
2017-08-10 21:04:45 +08:00
Daniel Bevenius
02371c7a8c doc: fix order of AtExit callbacks in addons.md
The sanity_check AtExit callback needs to come last to verify that the
other callbacks have been completed. This was not noticed before as this
code was not been executed.

PR-URL: https://github.com/nodejs/node/pull/14048
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2017-08-10 07:24:52 +02:00
Daniel Bevenius
06ed0e8187 doc: remove undef NDEBUG from addons.md
When working on commit 0d95a0b60a
("test: remove undef NDEBUG from at-exit addons test) I searched for
usages of undef NDEBUG but did not include the doc directory (but I did
include the test directory) and missed this one.

Commit 1f02569f8db9cb0101807df4982534738f0161b2 ("tools: fix
tools/addon-verify.js") enables the code in the "AtExit" section to be
included in the test/addons diretory and this code will again be
tested.

PR-URL: https://github.com/nodejs/node/pull/14048
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2017-08-10 07:24:39 +02:00
Daniel Bevenius
7f81400723 tools: fix tools/addon-verify.js
The current implementation of addon-verify.js is including the code
for the "Function arguments" section in test/addons/01_callbacks and
there is no directory generated or the "Function arguments section".
This continues and leads to the last section, "AtExit", code to be
excluded. There is an test/addons/07_atexit_hooks but it contains code
from the "Passing wrapped objects around" section.

This commit modifies addon-verify to associate headers with code and
then iterates over the set and generates the files as a separate step.

PR-URL: https://github.com/nodejs/node/pull/14048
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2017-08-10 07:24:30 +02:00
Anna Henningsen
b72e702247 2017-08-09, Version 8.3.0 (Current)
V8 6.0:

  The V8 engine has been upgraded to version 6.0, which has a significantly
  changed performance profile.
  [#14574](https://github.com/nodejs/node/pull/14574)

  More detailed information on performance differences can be found at
  https://medium.com/the-node-js-collection/get-ready-a-new-v8-is-coming-node-js-performance-is-changing-46a63d6da4de

Other notable changes:

* **DNS**
  * Independent DNS resolver instances are supported now, with support for
    cancelling the corresponding requests.
    [#14518](https://github.com/nodejs/node/pull/14518)

* **N-API**
  * Multiple N-API functions for error handling have been changed to support
    assigning error codes.
    [#13988](https://github.com/nodejs/node/pull/13988)

* **REPL**
  * Autocompletion support for `require()` has been improved.
    [#14409](https://github.com/nodejs/node/pull/14409)

* **Utilities**
  * The WHATWG Encoding Standard (`TextDecoder` and `TextEncoder`) has
    been implemented as an experimental feature.
    [#13644](https://github.com/nodejs/node/pull/13644)

* **Added new collaborators**
  * [XadillaX](https://github.com/XadillaX) – Khaidi Chu
  * [gabrielschulhof](https://github.com/gabrielschulhof) – Gabriel Schulhof

Conflicts:
	src/node_version.h
2017-08-09 21:56:19 -04:00
Guy Margalit
c3c045aea0 stream: support readable/writableHWM for Duplex
This commits adds support for readableHighWaterMark and
writableHighWaterMark in Duplex stream, so that they can be set without
accessing the internal state.

Fixes: https://github.com/nodejs/node/issues/14555
PR-URL: https://github.com/nodejs/node/pull/14636
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2017-08-08 11:18:25 +02:00
James M Snell
4da8b99a74 console: coerce label to string in console.time()
Per the console spec, the label in console.time() is a string.
Per the console spec, the default value of label is `'default'`.

PR-URL: https://github.com/nodejs/node/pull/14643
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-08-07 22:22:59 -07:00
Jared Kantrowitz
80ebb4282d
src: adjust windows abort behavior
Raising SIGABRT is handled in the CRT in windows, calling _exit()
with ambiguous code "3" by default.

This adjustment to the abort behavior gives a more sane exit code
on abort, by calling _exit directly with code 134.

PR-URL: https://github.com/nodejs/node/pull/13947
Fixes: https://github.com/nodejs/node/issues/12271
Refs: https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/abort
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-08-07 22:46:01 -04:00
Jason Ginchereau
af70c3b478 n-api: optimize number API performance
- Add separate APIs for creating different kinds of numbers,
   because creating a V8 number value from an integer is faster
   than creating one from a double.
 - When getting number values, avoid getting the current context
   because the context will not actually be used and is expensive
   to obtain.
 - When creating values, don't use v8::TryCatch (NAPI_PREAMBLE),
   because these functions have no possibility of executing JS code.

Refs: https://github.com/nodejs/node/issues/14379
PR-URL: https://github.com/nodejs/node/pull/14573
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-08-07 17:31:17 -07:00
Rich Trott
0f325aaaeb doc: improve fs.read() doc text
PR-URL: https://github.com/nodejs/node/pull/14631
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-08-07 15:05:03 -07:00
dcharbonnier
680285c3b4 doc: clarify the position argument for fs.read
What happen to the file position after a read using a position null or
integer was not clear and you can assume that the cursor of the file
descriptor is updated even if position is an integer.

PR-URL: https://github.com/nodejs/node/pull/14631
Fixes: https://github.com/https://github.com/nodejs/node/issues/8397
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-08-07 15:04:55 -07:00
Timothy Gu
365b2e3424
encoding: rudimentary TextDecoder support w/o ICU
Also split up the tests.

PR-URL: https://github.com/nodejs/node/pull/14489
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-08-05 16:40:41 +08:00
James M Snell
45b7fc2039 http2: add some doc detail for invalid header chars
PR-URL: https://github.com/nodejs/node/pull/14239
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2017-08-04 12:57:39 -07:00
James M Snell
383a1696c0 http2: fix documentation errors
PR-URL: https://github.com/nodejs/node/pull/14239
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2017-08-04 12:57:32 -07:00
James M Snell
b484ea1fab http2: refactor trailers API
Rather than using the `'fetchTrailers'` event to collect trailers,
a new `getTrailers` callback option is supported. If not set, the
internals will skip calling out for trailers at all. Expands the
test to make sure trailers work from the client side also.

PR-URL: https://github.com/nodejs/node/pull/14239
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2017-08-04 12:57:13 -07:00
James M Snell
59e509808a http2: address initial pr feedback
PR-URL: https://github.com/nodejs/node/pull/14239
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2017-08-04 12:57:09 -07:00
Matteo Collina
78cd5fedd5 http2: make writeHead behave like HTTP/1.
PR-URL: https://github.com/nodejs/node/pull/14239
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2017-08-04 12:57:04 -07:00
Matteo Collina
a4017736d2 http2: doc and fixes to the Compatibility API
PR-URL: https://github.com/nodejs/node/pull/14239
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2017-08-04 12:56:50 -07:00
James M Snell
d6a774b1bd http2: add range support for respondWith{File|FD}
* respondWithFD now supports optional statCheck
* respondWithFD and respondWithFile both support offset/length for
  range requests
* Fix linting nits following most recent update

PR-URL: https://github.com/nodejs/node/pull/14239
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2017-08-04 12:56:45 -07:00
James M Snell
6911fe337c http2: refinement and test for socketError
Fixes: https://github.com/nodejs/http2/issues/184

Refines the `'socketError'` event a bit and adds a test for the
emission of the `'socketError'` event on the server. Client side
is tested separately

PR-URL: https://github.com/nodejs/node/pull/14239
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2017-08-04 12:56:34 -07:00
James M Snell
df0334669e doc: include http2.md in all.md
PR-URL: https://github.com/nodejs/node/pull/14239
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2017-08-04 12:56:14 -07:00
James M Snell
f070d784d6 http2: fix documentation nits
PR-URL: https://github.com/nodejs/node/pull/14239
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2017-08-04 12:56:10 -07:00
James M Snell
e71e71b513 http2: introducing HTTP/2
At long last: The initial *experimental* implementation of HTTP/2.

This is an accumulation of the work that has been done in the nodejs/http2
repository, squashed down to a couple of commits. The original commit
history has been preserved in the nodejs/http2 repository.

This PR introduces the nghttp2 C library as a new dependency. This library
provides the majority of the HTTP/2 protocol implementation, with the rest
of the code here providing the mapping of the library into a usable JS API.

Within src, a handful of new node_http2_*.c and node_http2_*.h files are
introduced. These provide the internal mechanisms that interface with nghttp
and define the `process.binding('http2')` interface.

The JS API is defined within `internal/http2/*.js`.

There are two APIs provided: Core and Compat.

The Core API is HTTP/2 specific and is designed to be as minimal and as
efficient as possible.

The Compat API is intended to be as close to the existing HTTP/1 API as
possible, with some exceptions.

Tests, documentation and initial benchmarks are included.

The `http2` module is gated by a new `--expose-http2` command line flag.
When used, `require('http2')` will be exposed to users. Note that there
is an existing `http2` module on npm that would be impacted by the introduction
of this module, which is the main reason for gating this behind a flag.

When using `require('http2')` the first time, a process warning will be
emitted indicating that an experimental feature is being used.

To run the benchmarks, the `h2load` tool (part of the nghttp project) is
required: `./node benchmarks/http2/simple.js benchmarker=h2load`. Only
two benchmarks are currently available.

Additional configuration options to enable verbose debugging are provided:

```
$ ./configure --debug-http2 --debug-nghttp2
$ NODE_DEBUG=http2 ./node
```

The `--debug-http2` configuration option enables verbose debug statements
from the `src/node_http2_*` files. The `--debug-nghttp2` enables the nghttp
library's own verbose debug output. The `NODE_DEBUG=http2` enables JS-level
debug output.

The following illustrates as simple HTTP/2 server and client interaction:

(The HTTP/2 client and server support both plain text and TLS connections)

```jt client = http2.connect('http://localhost:80');
const req = client.request({ ':path': '/some/path' });
req.on('data', (chunk) => { /* do something with the data */ });
req.on('end', () => {
  client.destroy();
});

// Plain text (non-TLS server)
const server = http2.createServer();
server.on('stream', (stream, requestHeaders) => {
  stream.respond({ ':status': 200 });
  stream.write('hello ');
  stream.end('world');
});
server.listen(80);
```

```js
const http2 = require('http2');
const client = http2.connect('http://localhost');

```

Author: Anna Henningsen <anna@addaleax.net>
Author: Colin Ihrig <cjihrig@gmail.com>
Author: Daniel Bevenius <daniel.bevenius@gmail.com>
Author: James M Snell <jasnell@gmail.com>
Author: Jun Mukai
Author: Kelvin Jin
Author: Matteo Collina <matteo.collina@gmail.com>
Author: Robert Kowalski <rok@kowalski.gd>
Author: Santiago Gimeno <santiago.gimeno@gmail.com>
Author: Sebastiaan Deckers <sebdeckers83@gmail.com>
Author: Yosuke Furukawa <yosuke.furukawa@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/14239
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2017-08-04 12:55:44 -07:00
James M Snell
b1909d3a70 tls: add tlsSocket.disableRenegotiation()
Allows TLS renegotiation to be disabled per `TLSSocket` instance.
Per HTTP/2, TLS renegotiation is forbidden after the initial
connection prefix is exchanged.

PR-URL: https://github.com/nodejs/node/pull/14239
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2017-08-04 12:55:30 -07:00
Rich Trott
1abfbbb1c4 doc: add entry for subprocess.killed property
PR-URL: https://github.com/nodejs/node/pull/14578
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-08-04 11:34:01 -07:00
Rich Trott
dd75005a9e doc: change child to subprocess
PR-URL: https://github.com/nodejs/node/pull/14578
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-08-04 11:32:38 -07:00
Greg Alexander
211df3fe8c util: implement %o and %O as formatting specifiers
Implementing the %o and %O formatting specifiers for util.format.
Based on discussion in issue, this specifier should just call
util.inspect to format the value.

PR-URL: https://github.com/nodejs/node/pull/14558
Fixes: https://github.com/nodejs/node/issues/14545
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
2017-08-04 19:30:42 +02:00
Vse Mozhet Byt
d41423fe72 doc: erase unneeded eslint-plugin-markdown comment
eslint-plugin-markdown comments affect only a code block below them,
so there is no need to cancel them for the rest code blocks.

PR-URL: https://github.com/nodejs/node/pull/14598
Refs:
 https://github.com/eslint/eslint-plugin-markdown#configuration-comments
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-03 20:51:20 +03:00
cjihrig
5a050550d3 dgram: add custom lookup function in sockets
This commit adds support for custom DNS lookup functions in
dgram sockets. This is similar to the existing feature in net
sockets.

Refs: https://github.com/nodejs/node/issues/6189
PR-URL: https://github.com/nodejs/node/pull/14560
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
2017-08-02 20:32:51 -04:00
Yuta Hiroto
46c3dd701a doc: fix typo in writing-and-running-benchmarks.md
PR-URL: https://github.com/nodejs/node/pull/14600
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2017-08-02 16:35:28 -07:00
Lance Ball
766506a2e9
repl: deprecate REPLServer.parseREPLKeyword
This method does not need to be visible to user code. It has been
undocumented since it was introduced which was perhaps v0.8.9.

The motivation for this change is that the method is simply an
implementation detail of the REPLServer behavior, and does
not need to be exposed to user code.

This change adds documentation of the method with a deprecation
warning, and a test that the method is actually documented.

PR-RUL: https://github.com/nodejs/node/pull/14223
Refs: https://github.com/nodejs/node/issues/7619
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-02 14:39:06 -04:00
Rich Trott
e506bcd899 tools: replace assert-throw-arguments custom lint
The functionality of ESLint custom rule assert-throws-arguments can be
replaced with no-restricted-syntax entries.

PR-URL: https://github.com/nodejs/node/pull/14547
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-02 09:27:35 -07:00