0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 07:27:22 +01:00
Commit Graph

109 Commits

Author SHA1 Message Date
estrada9166
a29089d7c8
doc: add new documentation lint rule
Add 80 characters limit to docs.
Change docs to fit 80 characters per row.

PR-URL: https://github.com/nodejs/node/pull/18726
Fixes: https://github.com/nodejs/node/issues/18703
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
2018-02-23 16:26:29 +00:00
Rich Trott
9cb96ac828 doc: remove extraneous "for example" text
No need to announce obvious example code as being example code. Remove
unneeded "for example" text as one small way to try to keep the docs
more concise..

PR-URL: https://github.com/nodejs/node/pull/18890
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matheus Marchini <matheus@sthima.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2018-02-23 02:53:21 +02:00
Ruben Bridgewater
6e1c25c456
errors: update all internal errors
This updates all internal errors to the new error type. While doing
so it removes unused errors.

A few errors currently seem to have the wrong type. To identify them
later, comments were added next to the error type.

PR-URL: https://github.com/nodejs/node/pull/18857
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-02-22 13:36:19 +00:00
James M Snell
d3569b623c
doc: remove **Note:** tags
Remove the various **Note:** prefixes throughout the docs.

PR-URL: https://github.com/nodejs/node/pull/18592
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2018-02-08 11:57:14 -05:00
Michaël Zasso
312414662b url: expose the WHATWG URL API globally
Install URL and URLSearchParams on the global object, like they can be
found in browser environments.

PR-URL: https://github.com/nodejs/node/pull/18281
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-01-31 16:00:51 +01:00
Gus Caplan
0993fbe5b2
vm: add modules
Adds vm.Module, which wraps around ModuleWrap to provide an interface
for developers to work with modules in a more reflective manner.

Co-authored-by: Timothy Gu <timothygu99@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/17560
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
2018-01-30 17:00:57 -08:00
Vse Mozhet Byt
6c76de13c5 doc: add missing link references
PR-URL: https://github.com/nodejs/node/pull/18222
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-01-18 13:21:23 +02:00
Vse Mozhet Byt
f7c709fdd0 doc: dedupe links
Replace some repeated full links
with concise ones and bottom references.

PR-URL: https://github.com/nodejs/node/pull/18213
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-01-18 03:15:02 +02:00
Jinho Bang
316b5efd6b n-api: throw RangeError napi_create_typedarray()
According to the ECMA spec, we should throw a RangeError in the
following cases:
  - `(length * elementSize) + offset` > the size of the array passed in
  - `offset % elementSize` != `0`

In the current implementation, this check was omitted. So, the following
code will cause a crash.
  ```
  napi_create_typedarray(env, napi_uint16_array, 2 /* length */,
                         buffer, 1 /* byte_offset */, &output_array);
  ```

This change fixes the problem and write some related tests.

Refs:
https://tc39.github.io/ecma262/#sec-typedarray-buffer-byteoffset-length

PR-URL: https://github.com/nodejs/node/pull/18037
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2018-01-16 15:22:36 -05:00
Joyee Cheung
1c29da8236
tls: migrate C++ errors to internal/errors.js
* Throw ERR_TLS_SNI_FROM_SERVER when setting server names on a
  server-side socket instead of returning silently
* Assert on wrap_->started and wrap_->ssl instead of throwing
  errors since these errors indicate that the user either uses
  private APIs, or monkey-patches internals, or hits a bug.

PR-URL: https://github.com/nodejs/node/pull/18125
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-01-17 02:20:36 +08:00
Jinho Bang
91c1ccd84f n-api: throw RangeError in napi_create_dataview() with invalid range
The API is required that `byte_length + byte_offset` is less than or
equal to the size in bytes of the array passed in. If not, a RangeError
exception is raised[1].

[1] https://nodejs.org/api/n-api.html#n_api_napi_create_dataview

PR-URL: https://github.com/nodejs/node/pull/17869
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@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>
2018-01-09 16:20:19 -08:00
Rich Trott
26607b825e doc: edit for concision
This removes some wordy phrases (notably "it is important to note
that").

PR-URL: https://github.com/nodejs/node/pull/17891
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-01-03 17:18:30 -08:00
James M Snell
ce22d6f917 http2: add altsvc support
Add support for sending and receiving ALTSVC frames.

PR-URL: https://github.com/nodejs/node/pull/17917
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-01-03 08:45:58 -08:00
sreepurnajasti
27470e4ec7
doc: correct spelling
PR-URL: https://github.com/nodejs/node/pull/17911
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Weijia Wang <starkwang@126.com>
2017-12-30 17:59:05 +01:00
Tobias Nießen
a82b1b7b30
errors: remove ERR_OUTOFMEMORY
PR-URL: https://github.com/nodejs/node/pull/17877
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-12-29 21:16:14 +01:00
Weijia Wang
d022cb1bdd lib: combine similar error codes
There two similar error codes in lib: "ERR_VALUE_OUT_OF_RANGE"
and "ERR_OUT_OF_RANGE". This change is to reduce them into
"ERR_VALUE_OUT_OF_RANGE"

Fixes: https://github.com/nodejs/node/issues/17603

PR-URL: https://github.com/nodejs/node/pull/17648
Fixes: https://github.com/nodejs/node/issues/17603
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-12-24 14:09:29 +08:00
kysnm
b98aaa312e
net: migrate errors to internal/errors
Throw ERR_SOCKET_CLOSED and ERR_SERVER_NOT_RUNNING
instead of the old-style errors in net.js.

PR-URL: https://github.com/nodejs/node/pull/17766
Refs: https://github.com/nodejs/node/issues/17709
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-12-24 02:16:44 +08:00
Mir Mufaqam Ali
79261f3003
tls: migrate errors in _tls_wrap.js
This migrates the old style error in _tls_wrap.js to
the new style error ERR_TLS_RENEGOTIATION_DISABLED.

Refs: https://github.com/nodejs/node/issues/17709

PR-URL: https://github.com/nodejs/node/pull/17792
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-12-24 00:03:39 +08:00
Vse Mozhet Byt
4d1baf82ae doc: fix links in errors.md
PR-URL: https://github.com/nodejs/node/pull/17829
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
2017-12-23 00:22:09 +02:00
James M Snell
6100e12667 fs: move type checking to js
PR-URL: https://github.com/nodejs/node/pull/17667
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2017-12-22 12:49:10 -08:00
kysnm
ab5a2aba38 repl: migrate errors to internal/errors
PR-URL: https://github.com/nodejs/node/pull/17716
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-12-22 13:27:25 -05:00
James M Snell
0babd181a0 http2: cleanup Http2Stream/Http2Session destroy
PR-URL: https://github.com/nodejs/node/pull/17406
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

This is a significant cleanup and refactoring of the
cleanup/close/destroy logic for Http2Stream and Http2Session.
There are significant changes here in the timing and ordering
of cleanup logic, JS apis. and various related necessary edits.
2017-12-18 10:19:21 -08:00
Ram Goli
3db136a74a
doc: change "Node.js style cb" to "error-first cb"
Change the awkward "Node.js style callback" phrasing to the more
informative "error-first callback."

PR-URL: https://github.com/nodejs/node/pull/17638
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2017-12-17 13:19:03 -05:00
Jose M. Palacios Diaz
845633a7c6
crypto: better docs for cases where peer's public key is invalid
changes in c++ are in the computeSecret function, but the thrown
exception that was moved to JS land was in BufferToPoint
function, here i let the allocation error be thrown so the only value
returned is the nullptr that i use later to catch the error in
computeSecret, to then construct the exception in JS land.

an ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY error was added to errors.js
and with that, subsequent changes to docs and tests were made.

PR-URL: https://github.com/nodejs/node/pull/16849
Refs: https://www.iacr.org/archive/pkc2003/25670211/25670211.pdf
Fixes: https://github.com/nodejs/node/issues/16625
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-12-01 21:18:11 +01:00
Jon Moss
b1e6c0d44c errors, child_process: use internal/errors codes
PR-URL: https://github.com/nodejs/node/pull/14998
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
2017-11-29 18:14:27 -05:00
Anna Henningsen
4503da8a3a
process: add flag for uncaught exception abort
Introduce `process.shouldAbortOnUncaughtException` to control
`--abort-on-uncaught-exception` behaviour, and implement
some of the domains functionality on top of it.

PR-URL: https://github.com/nodejs/node/pull/17159
Refs: https://github.com/nodejs/node/issues/17143
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
2017-11-29 15:58:42 +01:00
James M Snell
69e6c5a212
http2: major update to internals
This update does several significant things:

1. It eliminates the base Nghttp2* classes and folds those
   in to node::http2::Http2Session and node::http2::Http2Stream
2. It makes node::http2::Http2Stream a StreamBase instance and
   sends that out to JS-land to act as the [kHandle] for the
   JavaScript Http2Stream class.
3. It shifts some of the callbacks from C++ off of the JavaScript
   Http2Session class to the Http2Stream class.
4. It refactors the data provider structure for FD and Stream
   based sending to help encapsulate those functions easier
5. It streamlines some of the functions at the C++ layer to
   eliminate now unnecessary redirections
6. It cleans up node_http2.cc for better readability and
   maintainability
7. It refactors some of the debug output
8. Because Http2Stream instances are now StreamBases, they are
   now also trackable using async-hooks
9. The Stream::OnRead algorithm has been simplified with a
   couple bugs fixed.
10. I've eliminated node_http2_core.h and node_http2_core-inl.h
11. Detect invalid handshake a report protocol error to session
12. Refactor out of memory error, improve other errors
13. Add Http2Session.prototype.ping

PR-URL: https://github.com/nodejs/node/pull/17105
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sebastiaan Deckers <sebdeckers83@gmail.com>
2017-11-21 12:47:54 +01:00
Rich Trott
959c425a19 doc: make error descriptions more concise
Remove the practice of starting most error descriptions with "Used when"
or wordier variations.

Change errors of the form:

> Used when the type of an asynchronous resource is invalid.

...to:

> The type of an asynchronous resource was invalid.

Change errors of the form:

> The `'ERR_INVALID_CURSOR_POS'` is thrown specifically when a cursor on
> a given stream is attempted to move to a specified row without a
> specified column.

...to:

> A cursor on a given stream cannot be moved to a specified row without
> a specified column.

PR-URL: https://github.com/nodejs/node/pull/16954
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-11-17 09:57:00 -08:00
joelostrowski
6ee985f311 tls: implement clientCertEngine option
Add an option 'clientCertEngine' to `tls.createSecureContext()` which gets
wired up to OpenSSL function `SSL_CTX_set_client_cert_engine`. The option
is passed through from `https.request()` as well. This allows using a custom
OpenSSL engine to provide the client certificate.
2017-11-11 13:35:23 -08:00
Delapouite
4924fb3226 doc: add links to EventEmitter in errors.md
PR-URL: https://github.com/nodejs/node/pull/16861
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2017-11-07 15:22:09 +02:00
Joyee Cheung
0a84e95cd9 http: improve errors thrown in header validation
PR-URL: https://github.com/nodejs/node/pull/16719
Fixes: https://github.com/nodejs/node/issues/16714
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-11-06 18:24:34 +08:00
Joyee Cheung
11a9f36cae http2: improve errors thrown in header validation
PR-URL: https://github.com/nodejs/node/pull/16718
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-11-06 17:25:34 +08:00
Anna Henningsen
14181a3368
lib: refactor ES module loader for readability
PR-URL: https://github.com/nodejs/node/pull/16579
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-11-03 01:11:11 +01:00
James M Snell
c3dc0e0d75 src: add CollectExceptionInfo & errors.SystemError
Preparing for the migration of existing UVException and ErrnoExceptions
from the native layer, add new `errors.SystemError` to internal/errors
and new `env->CollectExceptionInfo()` / `env->CollectUVExceptionInfo()`
methods.

PR-URL: https://github.com/nodejs/node/pull/16567
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-11-02 11:58:38 -07:00
James M Snell
67c8511ea1 src: use internal/errors for startSigintWatchdog
Move the throw out of c++ and into js using internal/errors

PR-URL: https://github.com/nodejs/node/pull/16546
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-11-01 21:42:15 -07:00
James M Snell
e567402aba crypto: migrate CipherBase to internal/errors
Migrates most of CipherBase errors to use internal/errors.
There are still a handful remaining that need to be handled
separately

PR-URL: https://github.com/nodejs/node/pull/16527
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-10-30 07:56:27 -07:00
Jon Moss
863d1922df doc: add link for stream.pipe()
PR-URL: https://github.com/nodejs/node/pull/16593
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-10-29 20:34:39 +02:00
Matteo Collina
6e86a6651c stream: complete migration to internal/errors
Complete the migration to the new error system of _stream_readable
and _stream_writable. Adds the corresponding documentation.

PR-URL: https://github.com/nodejs/node/pull/16589
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-10-29 18:57:28 +01:00
James M Snell
896eaf6820 zlib: finish migrating to internal/errors
PR-URL: https://github.com/nodejs/node/pull/16540
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-10-29 10:18:23 -07:00
Ben Halverson
88fb359c57 stream: migrate _stream_readable use error codes
PR-URL: https://github.com/nodejs/node/pull/15042
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-10-29 12:29:29 +01:00
Rami Moshe
9788e96836
querystring: convert to using internal/errors
PR-URL: https://github.com/nodejs/node/pull/15565
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2017-10-28 14:04:53 -04:00
James M Snell
ee76f3153b crypto: migrate setFipsCrypto to internal/errors
With the exception of ThrowCryptoError, use internal/errors
to report fips unavailable or forced

PR-URL: https://github.com/nodejs/node/pull/16428
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2017-10-27 08:13:01 -07:00
James M Snell
fb477f3fa5 doc: add missing error codes
PR-URL: https://github.com/nodejs/node/pull/16450
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
2017-10-26 07:58:22 -07:00
James M Snell
eeada6ca63 crypto: migrate timingSafeEqual to internal/errors
PR-URL: https://github.com/nodejs/node/pull/16448
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-10-26 07:47:16 -07:00
James M Snell
a78327f48b crypto: migrate setEngine to internal/errors
PR-URL: https://github.com/nodejs/node/pull/16429
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-10-25 11:33:19 -07:00
Anatoli Papirovski
73533a1932
http2: do not allow socket manipulation
Because of the specific serialization and processing requirements
of HTTP/2, sockets should not be directly manipulated. This
forbids any interactions with destroy, emit, end, pause, read,
resume and write methods of the socket. It also redirects
setTimeout to session instead of socket.

PR-URL: https://github.com/nodejs/node/pull/16330
Fixes: https://github.com/nodejs/node/issues/16252
Refs: https://github.com/nodejs/node/pull/16211
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-10-25 12:50:44 -04:00
James M Snell
7124b466d9 crypto: refactor argument validation for pbkdf2
Move input argument validation to js, using internal/errors.

Also update docs

* `password` and `salt` may be Buffers or any TypedArrays
* `crypto.DEFAULT_ENCODING` changes the returned derivedKey type

PR-URL: https://github.com/nodejs/node/pull/15746
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-10-23 15:52:11 -07:00
Vse Mozhet Byt
93d113510d doc: replace undocumented encoding aliases
PR-URL: https://github.com/nodejs/node/pull/16368
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Bryan English <bryan@bryanenglish.com>
2017-10-22 13:12:24 +03:00
James M Snell
4cf56ad6f2 inspector: migrate to internal/errors
PR-URL: https://github.com/nodejs/node/pull/15619
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-10-16 09:31:18 -07:00
matzavinos
7f55349079 net: convert to using internal/errors
Covert lib/net.js over to using lib/internal/errors.js

- Replace thrown errors in lib/net.js
  with errors from lib/internal/errors.
  The ERR_INVALID_OPT_VALUE error have been used
  in the Server.prototype.listen() method
- Update tests according to the above modifications

PR-URL: https://github.com/nodejs/node/pull/14782
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: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-10-15 11:48:38 +08:00