0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 15:06:33 +01:00
Commit Graph

25396 Commits

Author SHA1 Message Date
H1Gdev
74562356db doc: fix typo in Buffer API
PR-URL: https://github.com/nodejs/node/pull/25544
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2019-01-18 02:40:19 +02:00
Rich Trott
f2e3a4ed8e test: prepare test-hash-seed for CI
Reduce the time it takes to run test/pummel/test-hash-seed by switching
from spawnSync() to spawn(). On my computer, this reduces the runtime
from about 80 seconds to about 40 seconds. This test is not (yet) run
regularly on CI, but when it was run recently, it timed out.

PR-URL: https://github.com/nodejs/node/pull/25522
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
2019-01-17 16:14:45 -08:00
Rich Trott
eed096ea2e test: refactor min() in test-hash-seed
Replace min() function with Math.min(...).

PR-URL: https://github.com/nodejs/node/pull/25522
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
2019-01-17 16:14:41 -08:00
Rich Trott
5fdd554730 test: add check for wrk to test-keep-alive
test/pummel/test-keep-alive.js requires `wrk` to be installed. Check if
it is, and skip the test if it isn't.

This is yet another step in preparation for running pummel tests in CI
daily.

PR-URL: https://github.com/nodejs/node/pull/25516
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-01-17 16:13:04 -08:00
Michael Dawson
098c2cc348 doc: add Rich back to TSC list
Fixes: https://github.com/nodejs/TSC/issues/650

PR-URL: https://github.com/nodejs/node/pull/25535
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-01-17 18:04:36 -05:00
cjihrig
f6cd4e3e59
process: allow reading umask in workers
Refs: https://github.com/nodejs/node/issues/25448
PR-URL: https://github.com/nodejs/node/pull/25526
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2019-01-17 16:32:21 -05:00
Michael Dawson
1375af204a test: revert fail coverage target if tests fail"
This reverts commit f216d5bbb1.
Seems like it breaks the nightly job so reverting until
we figure that out.

PR-URL: https://github.com/nodejs/node/pull/25543
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-01-17 12:58:29 -05:00
Bradley Farias
9d5fbeb55f policy: manifest with subresource integrity checks
This enables code loaded via the module system to be checked for
integrity to ensure the code loaded matches expectations.

PR-URL: https://github.com/nodejs/node/pull/23834
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2019-01-17 09:43:42 -06:00
Brian White
7b6e9aedaf test: fix test-repl timeout and tmpdir refresh
PR-URL: https://github.com/nodejs/node/pull/25425
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
2019-01-17 19:29:27 +05:30
Sam Roberts
870186d69a doc: add metadata about ecdh curve options
- DEFAULT_ECDH_CURVE default changed to 'auto' for 10.0.0
- ecdhCurve parameter allowed multiple values and 'auto' from 9.0.0

PR-URL: https://github.com/nodejs/node/pull/25502
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-01-17 12:41:26 +01:00
Daniel Bevenius
228a3f840d src: fix FIPS section in Sign::SignFinal
Currently, while FIPS is not supported yet for this release there might
be an option to dynamically link against a FIPS compatible OpenSSL
version.

This commit fixes the compiler errors.

PR-URL: https://github.com/nodejs/node/pull/25412
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-01-17 05:25:59 +01:00
Daniel Bevenius
7e7266a803 build: introduce --openssl-is-fips flag
This commit introduces a new configuration flag named
--openssl-is-fips which is intended to be used when linking against
an OpenSSL library that is FIPS compatible.

The motivation for this is that Red Hat Enterprise Linux 8 (RHEL8)
comes with OpenSSL 1.1.1 and includes FIPS support, and we would
like to be able to dynamically link against this version and also have
FIPS features enabled in node, like would be done when statically
linking and using the --openssl-fips flag.

The suggestion here is to introduce a new flag:
$ ./configure --help
...
--openssl-is-fips specifies that the shared OpenSSL version is FIPS
                  compatible

This flag could be used in combination with the shared-openssl flag:
$ ./configure --shared-openssl ---openssl-is-fips

This will enable FIPS support in node and the runtime flags will be
availalbe to enable FIPS (--enable-fips, --force-fips).

PR-URL: https://github.com/nodejs/node/pull/25412
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-01-17 05:25:36 +01:00
Benjamin Coe
b7bbd871af
deps: v8, cherry-pick 9365d09, aac2f8c, 47d34a3
Original commit message 9365d09:

        [coverage] Rework continuation counter handling

        This changes a few bits about how continuation counters are handled.

        It introduces a new mechanism that allows removal of a continuation
        range after it has been created. If coverage is enabled, we run a first
        post-processing pass on the AST immediately after parsing, which
        removes problematic continuation ranges in two situations:

        1. nested continuation counters - only the outermost stays alive.
        2. trailing continuation counters within a block-like structure are
           removed if the containing structure itself has a continuation.

        R=bmeurer@chromium.org, jgruber@chromium.org, yangguo@chromium.org

        Bug: v8:8381, v8:8539
        Change-Id: I6bcaea5060d8c481d7bae099f6db9f993cc30ee3
        Reviewed-on: https://chromium-review.googlesource.com/c/1339119
        Reviewed-by: Yang Guo <yangguo@chromium.org>
        Reviewed-by: Leszek Swirski <leszeks@chromium.org>
        Reviewed-by: Georg Neis <neis@chromium.org>
        Commit-Queue: Jakob Gruber <jgruber@chromium.org>
        Cr-Commit-Position: refs/heads/master@{#58443}

    Refs: v8/v8@9365d09

    Original commit message aac2f8c:

        [coverage] Filter out singleton ranges that alias full ranges

        Block coverage is based on a system of ranges that can either have
        both a start and end position, or only a start position (so-called
        singleton ranges). When formatting coverage information, singletons
        are expanded until the end of the immediate full parent range. E.g.
        in:

        {0, 10}  // Full range.
        {5, -1}  // Singleton range.

        the singleton range is expanded to {5, 10}.

        Singletons are produced mostly for continuation counters that track
        whether we execute past a specific language construct.

        Unfortunately, continuation counters can turn up in spots that confuse
        our post-processing. For example:

        if (true) { ... block1 ... } else { ... block2 ... }

        If block1 produces a continuation counter, it could end up with the
        same start position as the else-branch counter. Since we merge
        identical blocks, the else-branch could incorrectly end up with an
        execution count of one.

        We need to avoid merging such cases. A full range should always take
        precedence over a singleton range; a singleton range should never
        expand to completely fill a full range. An additional post-processing
        pass ensures this.

        Bug: v8:8237
        Change-Id: Idb3ec7b2feddc0585313810b9c8be1e9f4ec64bf
        Reviewed-on: https://chromium-review.googlesource.com/c/1273095
        Reviewed-by: Georg Neis <neis@chromium.org>
        Reviewed-by: Yang Guo <yangguo@chromium.org>
        Commit-Queue: Jakob Gruber <jgruber@chromium.org>
        Cr-Commit-Position: refs/heads/master@{#56531}

    Refs: v8/v8@aac2f8c

    deps: V8: backport 47d34a3

    Original commit message:

        Revert "[coverage] change block range to avoid ambiguity."

        This reverts commit 471fef0469d04d7c487f3a08e81f3d77566a2f50.

        Reason for revert: A more general fix incoming at https://crrev.com/c/1273095.

        Original change's description:
        > [coverage] change block range to avoid ambiguity.
        >
        > By moving the block range end to left of closing bracket,
        > we can avoid ambiguity where an open-ended singleton range
        > could be both interpreted as inside the parent range, or
        > next to it.
        >
        > R=<U+200B>verwaest@chromium.org
        >
        > Bug: v8:8237
        > Change-Id: Ibc9412b31efe900b6d8bff0d8fa8c52ddfbf460a
        > Reviewed-on: https://chromium-review.googlesource.com/1254127
        > Reviewed-by: Georg Neis <neis@chromium.org>
        > Commit-Queue: Yang Guo <yangguo@chromium.org>
        > Cr-Commit-Position: refs/heads/master@{#56347}

        TBR=yangguo@chromium.org,neis@chromium.org,verwaest@chromium.org

        # Not skipping CQ checks because original CL landed > 1 day ago.

        Bug: v8:8237
        Change-Id: I39310cf3c2f06a0d98ff314740aaeefbfffc0834
        Reviewed-on: https://chromium-review.googlesource.com/c/1273096
        Reviewed-by: Jakob Gruber <jgruber@chromium.org>
        Reviewed-by: Toon Verwaest <verwaest@chromium.org>
        Reviewed-by: Yang Guo <yangguo@chromium.org>
        Commit-Queue: Jakob Gruber <jgruber@chromium.org>
        Cr-Commit-Position: refs/heads/master@{#56513}

    Refs: 47d34a317e

PR-URL: https://github.com/nodejs/node/pull/25429
Reviewed-By: Yang Guo <yangguo@chromium.org>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2019-01-16 17:35:52 -08:00
Anna Henningsen
8528c21188
src: call Environment::Exit() for fatal exceptions
Call `Environment::Exit()` rather than the process-wide
`exit()` function, since JS exceptions generally only affect
the current JS engine instance.

PR-URL: https://github.com/nodejs/node/pull/25472
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2019-01-16 22:58:16 +08:00
Anna Henningsen
84e90decd5
src: reset StopTracingAgent() before platform teardown
This makes sure that `StopTracingAgent()` is always called
before tearing down the `tracing::Agent`,
since previously its destructor might have tried to access the
agent, which would be destroyed by the (earlier) `Dispose()` call.

PR-URL: https://github.com/nodejs/node/pull/25472
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2019-01-16 22:58:04 +08:00
Rich Trott
391f839563 test: refactor pummel/test-net-pingpong
* Use port 0 instead of `common.PORT`.
* Use `//` for comments, capitalize comments, and add punctuation.

PR-URL: https://github.com/nodejs/node/pull/25485
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-01-16 06:49:22 -08:00
Rich Trott
e675d4bd2b test: refactor pummel/test-net-many-clients
* Use port 0 instead of `common.PORT`.
* Reduce `concurrent` from 100 to 50 and `connections_per_client` from 5
  to 3. This is to avoid side effects from other tests. Prior to this
  change, running this along with test-keep-alive would result in
  failures on my local setup, apparently due to network throttling.
* Remove unnecessary `console.log()` and improve remaining
  `console.log()` to provide clearer information.

PR-URL: https://github.com/nodejs/node/pull/25485
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-01-16 06:49:18 -08:00
Rich Trott
b39234a4a8 test: refactor pummel/test-net-connect-econnrefused
* Reduce ROUNDS and ATTEMPTS_PER_ROUND by half to avoid spurious test
  failures as a result of side effects from other tests. (For my local
  setup, test-keep-alive seems to cause this test to fail with ETIMEDOUT
  and/or EADDRNOTAVAIL. It would seem to be a result of throttling.
  Reducing the pummel-iness of that test and this one seems to solve the
  problem.)
* Apply capitalization and punctuation to comment.

PR-URL: https://github.com/nodejs/node/pull/25485
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-01-16 06:49:15 -08:00
Rich Trott
46fb276529 test: refactor pummel/test-keep-alive
* Reduce concurrent and duration options by half so as to avoid
  interference with other tests. (Excessive TCP activity in this test
  resulted in throttling that caused subsequent tests to fail on my
  local setup.)
* Use an OS-provided port rather than `common.PORT`. This possibly
  reduces side-effects on other tests (that may also be using
  `common.PORT`).
* Add punctuation in comments.

PR-URL: https://github.com/nodejs/node/pull/25485
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-01-16 06:49:12 -08:00
Joyee Cheung
2190d47d60
src: remove unused internalBinding('config') properties
Remove the following properties:

- `preserveSymlinks`
- `preserveSymlinksMain`
- `experimentalModules`
- `userLoader`
- `experimentalVMModules`
- `experimentalREPLAwait`
- `exposeInternals`

We used to use them to pass cli option values from C++ into
JS, but now the values are obtained in JS land using
`require('internal/options').getOptionValue` instead so they
are unused.

Also removes `test/parallel/test-internal-modules-expose.js`
which tests `--expose-internals`.
We already have hundreds of tests depending on `--expose-internals`,
they are more than enough to test the functionality of the flag.

PR-URL: https://github.com/nodejs/node/pull/25463
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2019-01-16 21:54:26 +08:00
Joyee Cheung
cd70cbcbdd
src: pass cli options to bootstrap/loaders.js lexically
Instead of using `internalBinding('config')` which should be used
to carry information about build-time options, directly pass the
run-time cli options into bootstrap/loaders.js lexically via
function arguments.

PR-URL: https://github.com/nodejs/node/pull/25463
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2019-01-16 21:54:23 +08:00
Joyee Cheung
6b2af91a88
process: register the inspector async hooks in bootstrap/node.js
So it's easier to tell the side effects of this setup.

PR-URL: https://github.com/nodejs/node/pull/25443
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-01-16 16:19:22 +08:00
Eugene Ostroukhov
c7ec5e44bd
inspector, test: verify reported console message
Many Inspector protocol clients rely on the top frame reported for the
console messages. This test makes sure correct location is reported.

PR-URL: https://github.com/nodejs/node/pull/25455
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-01-16 13:56:57 +08:00
Joyee Cheung
b367ab2a66
process: refactor coverage setup during bootstrap
- Renamed `internal/process/write-coverage.js` to
  `internal/coverage-gen/with_instrumentation.js`,
  `internal/process/coverage.js` to
  `internal/coverage-gen/with_profiler.js` to distinguish
  the two better and added comments.
- Separate the coverage directory setup and the connection
  setup, moves the directory setup into `node.js` and
  closer to the exit hooks because that's where it's used.
- Moves the `process.reallyExit` overwrite and
  `process.on('exit')` hooks setup into bootstrap/node.js
  for clarity, and move them to a later stage of
  bootstrap since they do not have to happen that early.

PR-URL: https://github.com/nodejs/node/pull/25398
Reviewed-By: Ben Coe <bencoe@gmail.com>
2019-01-16 13:49:36 +08:00
Minwoo Jung
2b401e33de os: add fallback for undefined CPUs
For an unsupported OS, a call to os.cpus() throws an error
within os.cpus() itself where it tries to get the length of it.
This fixes the issue by adding fallback for undefined CPUs.

Fixes: https://github.com/nodejs/node/issues/25483
PR-URL: https://github.com/nodejs/node/pull/25493
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>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-01-16 12:41:56 +09:00
cjihrig
0759cbfc77
src: remove unused variable
PR-URL: https://github.com/nodejs/node/pull/25481
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-01-15 17:15:19 -05:00
Joyee Cheung
2c7f4f474b
process: allow StartExecution() to take a main script ID
The idea is to allow the C++ layer to run arbitrary scripts
as the main script. This paves the way for

- cctest of the execution of Node.js instances
- Earlier handling of per-process CLI options that affect
  execution modes (those usually do not make sense for the
  embedders).
- Targets like mkcodecache or mksnapshot.

Also moves the handling of `_third_party_main.js` into C++.

PR-URL: https://github.com/nodejs/node/pull/25474
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
2019-01-16 03:42:41 +08:00
Rich Trott
27f6d04dcf test: improve known_issues/test-vm-timeout-escape-queuemicrotask
Improve known_issues/test-vm-timeout-escape-queuemicrotask to mitigate
CI failures on ubuntu1604-arm64. Failures are due to a race condition.
Use `common.platformTimeout()` to help, adjust timeout to make sure
`queueMicrotasks()` has a chance to run, and improve error message.

PR-URL: https://github.com/nodejs/node/pull/25503
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Coe <bencoe@gmail.com>
2019-01-15 05:59:43 -08:00
Refael Ackermann
f216d5bbb1 build,test: fail coverage target if tests fail
PR-URL: https://github.com/nodejs/node/pull/25432
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2019-01-15 07:58:39 +01:00
Matteo Collina
2f1ae9eebb doc: revert incorrect change on readable._read
https://github.com/nodejs/node/pull/17979 introduced a change in the
doc that was not correct about _read always being called asynchronously.
This does not hold true when it is in flowing mode.

See: https://github.com/nodejs/node/pull/17979
Fixes: https://github.com/nodejs/node/issues/24919

PR-URL: https://github.com/nodejs/node/pull/25442
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
2019-01-15 09:44:45 +05:30
Sam Roberts
66f45e7e5b doc: add TLSSocket.isSessionReused() docs
The API has existed forever and is used in our unit tests. It is
supported for TLS1.3 as well as 1.2 and useful for troubleshooting, so
it should be documented.

PR-URL: https://github.com/nodejs/node/pull/25423
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-01-14 15:34:53 -08:00
Sam Roberts
273d7dd8b8 doc: improve Sign/Verify examples and docs
- Use complete examples that can be pasted and run as-is
- Move note about algorithm to the functions it applies to
- Uncapitalize inconsistence use of "Class"
- Use both EC and RSA keys in the examples
- Note that hash and digest are two names for the same algorithms

PR-URL: https://github.com/nodejs/node/pull/25452
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-01-14 15:32:57 -08:00
ZYSzys
1c7b5db627
test: add test for fs.lchmod
PR-URL: https://github.com/nodejs/node/pull/25439
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Masashi Hirano <shisama07@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-01-14 18:36:32 +01:00
Joyee Cheung
48f9b36459
src: move node::errno_string into node_errors.h/cc
Move `node::errno_string` into node_errors.h/cc and move it into
the `node:errors` namespace to reduce the size of the header.
It's not on any performance-critical code path so does not need
to be inlined.

PR-URL: https://github.com/nodejs/node/pull/25396
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-01-14 18:03:22 +01:00
Refael Ackermann
d1b7193428
deps,v8: silence V8 self-deprecation warnings
PR-URL: https://github.com/nodejs/node/pull/25394
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yang Guo <yangguo@chromium.org>
2019-01-14 17:44:13 +01:00
Ankur Oberoi
eb5aab2c46
util: fixes type in argument type validation error
PR-URL: https://github.com/nodejs/node/pull/25103
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-01-14 17:34:25 +01:00
Richard Lau
bd8d682e21
build: set -blibpath: for AIX
https://github.com/nodejs/node/pull/17604 refactored the gyp files
so that `-blibpath:` on AIX was only set if `node_shared=="true"`.
Restore the setting for non-shared builds.

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

PR-URL: https://github.com/nodejs/node/pull/25447
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2019-01-14 13:51:08 +01:00
Vse Mozhet Byt
0e1cf1eb1a doc: fix section order in vm.md
This PR just places the `vm.SourceTextModule` class section
after the `vm.Script` class section, restoring the alphabetical order.

PR-URL: https://github.com/nodejs/node/pull/25374
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-01-14 09:36:41 +01:00
Sam Roberts
374bddaaa1 test: rework ephemeralkeyinfo to run in parallel
Remove:
- use of tls global so tests can run in parallel
- test counting in favour of common.mustCall()
- limit of only one cipher suite per ephemeral key type tested

The last change  will allow adding TLS 1.3 cipher suites and testing
'ECDH' key info with them.

PR-URL: https://github.com/nodejs/node/pull/25409
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2019-01-14 08:01:40 +01:00
Brian White
5021b259ed os: improve networkInterfaces() performance
PR-URL: https://github.com/nodejs/node/pull/25410
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-01-14 07:42:27 +01:00
Sam Roberts
641b0135cf test: check for tls renegotiation errors
Check that the return value and callback error for tls.renegotiate()
does not indicate a failure. Also, remove unnecessary line wrapping and
indentation.

PR-URL: https://github.com/nodejs/node/pull/25437
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-01-14 07:24:16 +01:00
Anto Aravinth
7f913293c1 http2: add test case for goaway
PR-URL: https://github.com/nodejs/node/pull/24054
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-01-14 08:22:01 +05:30
Vse Mozhet Byt
27dc74fdd0 doc: fix sorting in buffer.md
This PR places
`Buffer.from(object...)` section before
`Buffer.from(string...)` section
and upper-cased bottom references before backtick-started ones.

PR-URL: https://github.com/nodejs/node/pull/25477
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
2019-01-13 23:48:20 +02:00
Philipp Renoth
9e7d4cac3f doc: fix napi_open_callback_scope description
- parameter `resource_object` is mandatory

PR-URL: https://github.com/nodejs/node/pull/25366
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2019-01-13 23:03:35 +02:00
Rich Trott
c24fccf064 test: fix test-net-connect-econnrefused (again)
test-net-connect-econnrefused was recently fixed, but only in certain
circumstances. This change allows it to succeed whether it is invoked
with `node` or `tools/test.py`. Makes sure no Socket handles are left,
which is what the test is trying to determine, rather than failing if
there are no handles of any kind left.

PR-URL: https://github.com/nodejs/node/pull/25438
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-01-12 16:21:41 -08:00
Anna Henningsen
4da7e6e228
src: dispose of V8 platform in process.exit()
Calling `process.exit()` calls the C `exit()` function, which in turn
calls the destructors of static C++ objects. This can lead to race
conditions with other concurrently executing threads; disposing of all
Worker threads and then the V8 platform instance helps with this
(although it might not be a full solution for all problems of
this kind).

Refs: https://github.com/nodejs/node/issues/24403
Refs: https://github.com/nodejs/node/issues/25007

PR-URL: https://github.com/nodejs/node/pull/25061
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-01-12 20:10:04 +01:00
Joyee Cheung
92e95f17b6
src: simplify NativeModule caching and remove redundant data
- Remove `NativeModule._source` - the compilation is now entirely
  done in C++ and `process.binding('natives')` is implemented
  directly in the binding loader so there is no need to store
  additional source code strings.
- Instead of using an object as `NativeModule._cached` and insert
  into it after compilation of each native module, simply prebuild
  a JS map filled with all the native modules and infer the
  state of compilation through `mod.loading`/`mod.loaded`.
- Rename `NativeModule.nonInternalExists` to
  `NativeModule.canBeRequiredByUsers` and precompute that
  property for all the native modules during bootstrap instead
  of branching in every require call during runtime. This also fixes
  the bug where `worker_threads` can be made available with
  `--expose-internals`.
- Rename `NativeModule.requireForDeps` to
  `NativeModule.requireWithFallbackInDeps`.
- Add a test to make sure we do not accidentally leak any module
  to the global namespace.

PR-URL: https://github.com/nodejs/node/pull/25352
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-01-12 22:56:02 +08:00
Matteo Collina
18d3aebb06 doc: document that stream.on('close') was changed in Node 10
See: https://github.com/nodejs/node/issues/25373
See: https://github.com/nodejs/node/pull/18438

PR-URL: https://github.com/nodejs/node/pull/25413
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
2019-01-12 11:43:07 +01:00
Rich Trott
91ef9c4c3f test: remove unnecessary skipIfWorker()
test-inspector-port-cluster passes in workers. Remove skipIfWorker()
from the test.

PR-URL: https://github.com/nodejs/node/pull/25427
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-01-11 18:07:31 -08:00
Rich Trott
9e62bb54b3 test,worker: simplify common.isMainThread
Now that `worker_threads` do not require a flag, the logic around
loading `isMainThread` can be removed.

PR-URL: https://github.com/nodejs/node/pull/25426
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-01-11 18:06:11 -08:00