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

19639 Commits

Author SHA1 Message Date
Daijiro Wachi
a399881773 tools: add make lint-md-clean
PR-URL: https://github.com/nodejs/node/pull/12756
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2017-10-25 21:13:57 +02:00
Daijiro Wachi
212f4b981d build: add lint-md-build
PR-URL: https://github.com/nodejs/node/pull/12756
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2017-10-25 21:13:49 +02:00
Daijiro Wachi
f1329543d6 tools: add lint-md command in Makefile
PR-URL: https://github.com/nodejs/node/pull/12756
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2017-10-25 21:13:22 +02:00
Daijiro Wachi
92dff06122 tools: use remark-preset-lint-node in .remarkrc
PR-URL: https://github.com/nodejs/node/pull/12756
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2017-10-25 21:12:12 +02:00
Daijiro Wachi
2e1d092ff1 tools: introduce remark-preset-lint-node
PR-URL: https://github.com/nodejs/node/pull/12756
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2017-10-25 21:11:56 +02:00
Daijiro Wachi
503342e4e7 tools: introduce remark-cli@3.0.1
PR-URL: https://github.com/nodejs/node/pull/12756
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2017-10-25 21:11:44 +02:00
Anatoli Papirovski
cecbb595d5
net: fix timeout with null handle
This commit handles the case where _onTimeout is called with a
null handle.

Refs: https://github.com/nodejs/node/pull/15791
Fixes: https://github.com/nodejs/node/issues/16484
PR-URL: https://github.com/nodejs/node/pull/16489
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-10-25 14:48:30 -04: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
Teppei Sato
d2e44d5e7f doc: remove loader hooks from unsupported features
PR-URL: https://github.com/nodejs/node/pull/16465
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-10-25 10:57:51 -07:00
Daniel Bevenius
8a00f1d129 test: call toLowerCase on the resolved module
The commit updates test-require-resolve.js to call toLowerCase on the
resolved module instead of the path. Currently this test will fail if
the path to where node exists contains uppercase letters. For example:

```
$ out/Release/node
test/parallel/test-require-resolve.js
/root/rpmbuild/BUILD/node-v8.8.0/test/parallel
module.js:515
    throw err;
    ^

Error: Cannot find module
'/root/rpmbuild/build/node-v8.8.0/test/fixtures/nested-index/one'
    at Function.Module._resolveFilename (module.js:513:15)
    at Function.resolve (internal/module.js:18:19)
    at Object.<anonymous>
(/root/rpmbuild/BUILD/node-v8.8.0/test/parallel/test-require-resolve.js:37:11)
    at Module._compile (module.js:612:30)
    at Object.Module._extensions..js (module.js:623:10)
    at Module.load (module.js:531:32)
    at tryModuleLoad (module.js:494:12)
    at Function.Module._load (module.js:486:3)
    at Function.Module.runMain (module.js:653:10)
    at startup (bootstrap_node.js:187:16)
```

PR-URL: https://github.com/nodejs/node/pull/16486
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>>
Reviewed-By: Anna Henningsen <anna@addaleax.net>>
Reviewed-By: James M Snell <jasnell@gmail.com>>
2017-10-25 10:45:36 -07:00
Bryan English
8172f4547e buffer: move setupBufferJS to internal
Stashing it away in internal/buffer so that it can't be used in
userland, but can still be used in internals.

PR-URL: https://github.com/nodejs/node/pull/16391
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-10-25 10:36:17 -07:00
Jacob Hoffman-Andrews
3621889c80
doc: improve http2 documentation
Provide section headings for server-side and client side examples.
Add error handling and TLS to server-side example, following example
of `https`. Add error handling, TLS, more efficient Buffer usage,
and header printing to client example.

PR-URL: https://github.com/nodejs/node/pull/16366
Fixes: https://github.com/nodejs/node/issues/16345
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-10-25 13:21:39 -04: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
Franziska Hinkelmann
ed116dc3c6 test: fix test for inherited properties on vm
The known issue is fixed with
https://github.com/nodejs/node/pull/16293.

The text needs to call `Object.hasOwnProperty(this)`
instead of `this.hasOwnProperty()`, otherwise `this` is
from the wrong context is used.

Add a second test case taken verbatim from issue
https://github.com/nodejs/node/issues/5350

PR-URL: https://github.com/nodejs/node/pull/16411
Fixes: https://github.com/nodejs/node/issues/5350
Ref: https://github.com/nodejs/node/pull/16293
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-10-25 17:23:40 +02:00
cjihrig
9c6f6b0633
module: support custom paths to require.resolve()
This commit allows custom lookup paths to be passed to
require.resolve(). It also adds require.resolve.paths()
which retrieves the default resolution paths.

Fixes: https://github.com/nodejs/node/issues/5963
Fixes: https://github.com/nodejs/node/issues/16389
PR-URL: https://github.com/nodejs/node/pull/16397
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2017-10-25 09:14:14 -04:00
Jon Moss
4997894390 doc: fix wrong URL
PR-URL: https://github.com/nodejs/node/pull/16470
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-10-25 14:33:14 +02:00
Daijiro Wachi
f91218c58f doc: fix missing newline character
PR-URL: https://github.com/nodejs/node/pull/16447
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2017-10-25 12:21:43 +02:00
Daniel Bevenius
3e68e4414a src: remove empty comment in node_http2.h
This commit removes an "empty" comment in node_http2.h that I don't
think was intentional and as far as I can tell not a doxygen comment or
anything like that.

This was not picked up by the cpp linter so a suggestion has also been
added to the CheckComment function to detect these in the future.

PR-URL: https://github.com/nodejs/node/pull/16400
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-10-25 11:24:50 +02:00
Daniel Bevenius
50d727587e test: allow for different nsswitch.conf settings
The motivation for this commit is that these two test fail on systems
that have different Name Service Switch configuration settings. A
concrete example of this is when using Red Hat Enterprise Linux (RHEL)
7.

If Name Service Switch is available on the operating system then it
might be configured differently (/etc/nsswitch.conf).
If the system is configured with no dns the error code will be
AI_AGAIN, but if there are more services after the dns entry, for
example some linux distributions skip a myhostname service by default
which would still produce the ENOTFOUND error.

This commit suggests checking for either ENOTFOUND or EAI_AGAIN to
accommodate systems like the ones described above. The references below
indicate that others have run, or are running, into this aswell.

Refs: https://github.com/nodejs/node/issues/12075
Refs: https://github.com/nodejs/help/issues/687
Refs: https://github.com/nodejs/node/issues/15825
PR-URL: https://github.com/nodejs/node/pull/16378
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-10-25 11:12:06 +02:00
Myles Borins
e700385288 doc: fix spelling in v8.8.0 changelog
I hear that varible has an a in it.

PR-URL: https://github.com/nodejs/node/pull/16477
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2017-10-25 10:53:46 +02:00
Daniel Bevenius
6971f0292a src: remove unused include in tty_wrap.h
This commit removes the unused handle_wrap.h and instead adds uv.h which
is used.

PR-URL: https://github.com/nodejs/node/pull/16379
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-10-25 07:43:41 +02:00
Anna Henningsen
70670b056a test: make test-v8-serdes work without stdin
If `stdin` was closed or referred to a file, this didn't work,
because it was accessed via file descriptor.

Instead, use another generic native object.

cherry-picked from https://github.com/ayojs/ayo/pull/63

Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-10-25 07:15:44 +02:00
Alec Perkins
57a716febd doc: fix typo in changelog for 8.8.0
PR-URL: https://github.com/nodejs/node/pull/16462
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
2017-10-24 21:28:40 -07:00
Jon Moss
a82401e689
build: do not include deleted directory
`deps/uv/src/ares` hasn't existed since
libuv/libuv@41b1265af8 (mid 2012).

PR-URL: https://github.com/nodejs/node/pull/16384
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-10-24 22:30:31 -04:00
cjihrig
c5e3353953
test: add missing assertion
This commit adds an assertion to an existing try...catch
statement. Unfortunately, assert.throws() cannot be used
because the operation succeeds on some platforms, throws
EINVAL on some platforms, and throws ENOPROTOOPT on
others.

PR-URL: https://github.com/nodejs/node/pull/15519
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-10-24 20:29:25 -04:00
Daniel Bevenius
a9f50842f6
src: fix http2 debug build errors
Currently building with debug enabled produces the following errors:

In file included from ../src/node_http2.h:6:
../src/node_http2_core-inl.h:465:18: error: expected ';' after do/while
statement
  CHECK_GT(id, 0)
                 ^
                 ;
../src/node_http2_core-inl.h:469:18: error: use of undeclared identifier
'spec'
  OnPriority(id, spec.stream_id, spec.weight, spec.exclusive);
                 ^
../src/node_http2_core-inl.h:469:34: error: use of undeclared identifier
'spec'
  OnPriority(id, spec.stream_id, spec.weight, spec.exclusive);
                                 ^
../src/node_http2_core-inl.h:469:47: error: use of undeclared identifier
'spec'
  OnPriority(id, spec.stream_id, spec.weight, spec.exclusive);
                                              ^

This commit adds the missing semicolon to fix the above error.

../src/node_http2.cc:92:9: error: reference to non-static member
function must be called; did you mean to call
      it with no arguments?
  CHECK(object->Has(context, env()->ongetpadding_string()).FromJust());
        ^~~~~~
../src/util.h:120:20: note: expanded from macro 'CHECK'
    if (UNLIKELY(!(expr))) {
\
                   ^~~~
../src/util.h:107:44: note: expanded from macro 'UNLIKELY'

For this issue I was not sure what the correct check would be so I've
just commented it out and will update after feedback.

PR-URL: https://github.com/nodejs/node/pull/16432
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-10-25 00:15:03 +02:00
Myles Borins
068cede663
2017-10-24, Version 4.8.5 'Argon' (Maintenance)
This is a security release. All Node.js users should consult the
security release summary at:
https://nodejs.org/en/blog/vulnerability/oct-2017-dos/

for details on patched vulnerabilities.

Notable Changes:

* zlib:
  - CVE-2017-14919 - In zlib v1.2.9, a change was made that causes an
  error to be raised when a raw deflate stream is initialized with
  windowBits set to 8. On some versions this crashes Node and you
  cannot recover from it, while on some versions it throws an
  exception. Node.js will now gracefully set windowBits to 9
  replicating the legacy behavior to avoid a DOS vector.
  https://github.com/nodejs-private/node-private/pull/95

PR-URL: https://github.com/nodejs-private/node-private/pull/96
2017-10-24 18:05:12 -04:00
Myles Borins
274fa6eaaf
2017-10-24, Version 6.11.5 'Boron' (LTS)
This is a security release. All Node.js users should consult the
security release summary at:
https://nodejs.org/en/blog/vulnerability/oct-2017-dos/

for details on patched vulnerabilities.

Notable Changes:

* zlib:
  - CVE-2017-14919 - In zlib v1.2.9, a change was made that causes an
  error to be raised when a raw deflate stream is initialized with
  windowBits set to 8. On some versions this crashes Node and you
  cannot recover from it, while on some versions it throws an
  exception. Node.js will now gracefully set windowBits to 9
  replicating the legacy behavior to avoid a DOS vector.
  https://github.com/nodejs-private/node-private/pull/95

PR-URL: https://github.com/nodejs-private/node-private/pull/97
2017-10-24 17:54:24 -04:00
Myles Borins
9aa31bccb4
2017-10-24, Node.js Version 8.8.0 (Current)
Notable Changes:

* crypto:
  - expose ECDH class
    https://github.com/nodejs/node/pull/8188
* http2:
  - http2 is now exposed by defualt without the need for a flag
    https://github.com/nodejs/node/pull/15685
  - a new environment varible NODE\_NO\_HTTP2 has been added to allow
    userland http2 to be required
    https://github.com/nodejs/node/pull/15685
  - support has been added for generic `Duplex` streams
    https://github.com/nodejs/node/pull/16269
* module:
  - resolve and instantiate loader pipeline hooks have been added to
    the ESM lifecycle
    https://github.com/nodejs/node/pull/15445
* zlib:
  - CVE-2017-14919 - In zlib v1.2.9, a change was made that causes an
    error to be raised when a raw deflate stream is initialized with
    windowBits set to 8. On some versions this crashes Node and you
    cannot recover from it, while on some versions it throws an
    exception. Node.js will now gracefully set windowBits to 9
    replicating the legacy behavior to avoid a DOS vector.
    https://github.com/nodejs-private/node-private/pull/95

PR-URL: https://github.com/nodejs-private/node-private/pull/98
2017-10-24 17:50:44 -04:00
Nikolai Vavilov
4108072457 build,win: set /MP separately in Debug and Release
Setting /MP globally causes it to appear twice in the command line due
to a GYP bug, which causes the project to be rebuilt unconditionally due
to an msbuild bug.

PR-URL: https://github.com/nodejs/node/pull/16415
Fixes: https://github.com/nodejs/node/issues/16367
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-10-24 21:34:33 +03:00
Anatoli Papirovski
47ed02cec6
http2: fix errors in debug statements
When compiling with --debug-http2 flag, compiler complains
about passing wrong type of argument to DEBUG_HTTP2. Fix
by using static_cast to uint32_t.

PR-URL: https://github.com/nodejs/node/pull/16373
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-10-24 12:07:43 -04:00
Daijiro Wachi
986be03a4c doc: fix doc styles
CONTRIBUTING.md
  + L857: Unused definition
  + L861: Unused definition
  + L863: Unused definition

doc/api/assert.md
  + L719: Unused definition

doc/api/async_hooks.md
  + L460: Missing code-language flag

doc/api/child_process.md
  + L1362: Unused definition

doc/api/dns.md
  + L674: Unused definition

doc/api/esm.md
  + L178: Missing code-language flag

doc/api/http.md
  + L1868: Unused definition
  + L1887: Unused definition
  + L1888: Unused definition
  + L1889: Unused definition
  + L1916: Unused definition
  + L1917: Unused definition

doc/api/https.md
  + L260: Unused definition

doc/api/os.md
  + L1226: Unused definition

doc/api/process.md
  + L1888: Unused definition

doc/api/stream.md
  + L2227: Definitions with the same identifier

doc/guides/writing-and-running-benchmarks.md
  + L1: Missing newline character at end of file

Refs: https://github.com/nodejs/node/pull/12756
PR-URL: https://github.com/nodejs/node/pull/16385
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-10-24 18:04:18 +02:00
Refael Ackermann
7671f253f2
doc: add recommendations for first timers
PR-URL: https://github.com/nodejs/node/pull/16350
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
2017-10-24 10:26:20 -04:00
Jon Moss
88799dd3da lib: internal/errors should not be executable
PR-URL: https://github.com/nodejs/node/pull/16369
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2017-10-23 21:40:00 -07:00
James M Snell
7f9eb4c29c util: graduate TextEncoder/TextDecoder, tests
Add tests ported from Web Platform Tests.

Graduate TextEncoder / TextDecoder from experimental

PR-URL: https://github.com/nodejs/node/pull/15743
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-10-23 21:12:56 -07:00
James M Snell
b8bc652869 crypto: migrate crypto sign to internal/errors
Improve argument type checking and move into js, use internal/errors

PR-URL: https://github.com/nodejs/node/pull/15757
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-10-23 20:54:39 -07: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
Damian
4eb9365d66 doc: replace methods used in the example code
Methods `buf.writeUIntLE()` and `buf.writeUIntBE()` were used
in the example code for the section of the methods
`writeIntLE()` and `writeIntBE()` instead of the latter.

PR-URL: https://github.com/nodejs/node/pull/16416
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-10-23 22:55:45 +03:00
James M Snell
f16b9c189a http2: multiple style and performance updates
* move CHECK statements into DEBUG checks
* improve performance by removing branches
  * Several if checks were left in while the code was being developed.
    Now that the core API has stablized more, the checks are largely
    unnecessary and can be removed, yielding a significant boost in
    performance.
* refactor flow control for proper backpressure
* use std::queue for inbound headers
* use std::queue for outbound data
* remove now unnecessary FreeHeaders function
* expand comments and miscellaneous edits
* add a couple of misbehaving flow control tests

PR-URL: https://github.com/nodejs/node/pull/16239
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-10-23 11:57:13 -07:00
James M Snell
82b1660b1d benchmark: improve http2 benchmark configs
PR-URL: https://github.com/nodejs/node/pull/16239
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-10-23 11:57:07 -07:00
Anatoli Papirovski
c30f107103
http2: allow port 80 in http2.connect
Due to how WHATWG-URL parser works, port numbers are omitted if
they are the default port for a scheme. This meant that
http2.connect could not accept connections on port 80 with http
scheme. Fix this bug by detecting http: scheme and setting port
to 80.

PR-URL: https://github.com/nodejs/node/pull/16337
Fixes: https://github.com/nodejs/node/issues/14304
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2017-10-23 12:19:59 -04:00
Luigi Pinca
eb2fbd159f
http: do not blindly destroy UNIX domain sockets
`Connection: keep-alive` is now properly supported when making client
connections to UNIX domain sockets so `request.abort()` should not
blindly destroy the underlying socket.

PR-URL: https://github.com/nodejs/node/pull/15650
Refs: https://github.com/nodejs/node/pull/13214#issuecomment-304049523
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
2017-10-23 12:13:03 -04:00
Josh Gavant
88e55fe5e0
vm: deprecate vm.runInDebugContext
PR-URL: https://github.com/nodejs/node/pull/12815
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2017-10-23 17:17:16 +02:00
Anna Henningsen
3e25e4d00f
http: support generic Duplex streams
Support generic `Duplex` streams through more duck typing
on the server and client sides.

Since HTTP is, as a protocol, independent of its underlying transport
layer, Node.js should not enforce any restrictions on what streams
its HTTP parser may use.

Ref: https://github.com/nodejs/node/issues/16256
PR-URL: https://github.com/nodejs/node/pull/16267
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
2017-10-23 17:11:57 +02:00
Anna Henningsen
ab16eec436
http2: support generic Duplex streams
Support generic `Duplex` streams through using `StreamWrap`
on the server and client sides, and adding a `createConnection`
method option similar to what the HTTP/1 API provides.

Since HTTP2 is, as a protocol, independent of its underlying transport
layer, Node.js should not enforce any restrictions on what streams
its internals may use.

Ref: https://github.com/nodejs/node/issues/16256
PR-URL: https://github.com/nodejs/node/pull/16269
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-10-23 16:50:44 +02:00
Anna Henningsen
e340a66cb1
test: add makeDuplexPair() helper
Add a utility for adding simple, streams-API based duplex pairs.

PR-URL: https://github.com/nodejs/node/pull/16269
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-10-23 16:50:43 +02:00
Anna Henningsen
170bc31669
src: turn JS stream into a full duplex
Remove unused methods for reading data from `JSStream` and add
those required for emitting data or an EOF event to the JS side,
in essentially the same way that `LibuvStreamWrap` does it.

PR-URL: https://github.com/nodejs/node/pull/16269
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-10-23 16:50:42 +02:00
Anna Henningsen
127f83ab8d
src: allow top-level calls into JSStream
Allow `JSStream` instances to be used more flexibly by explicitly
enabling calls that have no JS stack below them.

PR-URL: https://github.com/nodejs/node/pull/16269
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-10-23 16:50:38 +02:00
c0b
ba4a0a6f5f
doc: fix http2 example with rstWithCancel
Replace the non-existent method rstStreamWithCancel with rstWithCancel

PR-URL: https://github.com/nodejs/node/pull/16365
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-10-23 10:22:45 -04:00
Weijia Wang
e79a61cf80 buffer: buffer.transcode to use internal/errors
`buffer.transcode` is still using raw TypeError. This change is to
convert it to use internal/errors.

Ref: https://github.com/nodejs/node/issues/11273
PR-URL: https://github.com/nodejs/node/pull/16352
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2017-10-23 19:17:44 +05:30