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

29613 Commits

Author SHA1 Message Date
Sam Roberts
dbaa4ca166 test: simplify test-https-simple.js
It had an unused `Agent` option (no such option exists), and some code
that common.must(Not)Call makes redundant.

PR-URL: https://github.com/nodejs/node/pull/31584
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-02-02 19:43:36 -08:00
ConorDavenport
99c8c6d80f
src: remove duplicate field env in CryptoJob class
Removed field env from cryptojob class, replaced with
function env() inherited from ThreadPoolWork

PR-URL: https://github.com/nodejs/node/pull/31554
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2020-02-02 09:06:42 -08:00
Denys Otrishko
aec9ad8f6c
src: fix console debug output on Windows
The FWrite function on Windows assumed that MultiByteToWideChar
automatically null-terminates the resulting string, but it will only do
so if the size of the source was passed as -1 or null character was
explicitly counted in the size. The FWrite uses std::string and its
`.size()` method which doesn't count the null character even though the
`.data()` method adds it to the resulting string.

https://docs.microsoft.com/en-us/windows/win32/api/stringapiset/nf-stringapiset-multibytetowidechar#remarks
> MultiByteToWideChar does not null-terminate an output string if the
  input string length is explicitly specified without a terminating null
  character. To null-terminate an output string for this function, the
  application should pass in -1 or explicitly count the terminating null
  character for the input string.

PR-URL: https://github.com/nodejs/node/pull/31580
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-02-02 14:12:23 +01:00
Ben Noordhuis
dbe881b64c
test: show child stderr output in largepages test
The test starts child processes. A recent change is suspected of causing
flaky crashes on one of the alpine buildbots but we can't know for sure
because the test hides the child's stderr.

Refs: https://github.com/nodejs/node/pull/31547#issuecomment-581076515

PR-URL: https://github.com/nodejs/node/pull/31612
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-02-02 13:41:37 +01:00
Anna Henningsen
9528f95336 test: mark additional tests as flaky on Windows
Basically, any of the tests that failed in the runs for
https://github.com/nodejs/node/pull/31602 which was not already
marked as flaky.

PR-URL: https://github.com/nodejs/node/pull/31606
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2020-02-01 22:58:56 +01:00
Anna Henningsen
06deb94714
test: fix flaky test-memory-usage
abe6a2e3d1 introduced a test that verifies that ArrayBuffer
allocations are tracked. However, V8 supports concurrent freeing
of such allocations on background threads, meaning that the results
may be subject to race conditions sometimes.

Disabling concurrent freeing makes the test pass consistently.

Refs: https://github.com/nodejs/node/pull/31550

PR-URL: https://github.com/nodejs/node/pull/31602
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-02-01 21:15:40 +01:00
Ben Noordhuis
938abd9535
src: use __executable_start for linux hugepages
`__executable_start` is provided by GNU's and LLVM's default linker
scripts, obviating the need to plug in a custom linker script.

The problem with our bespoke linker script is that it works with ld.bfd
but not ld.gold and cannot easily be ported because the latter linker
doesn't understand the `INSERT BEFORE` directive.

The /proc/self/maps scanner is updated to account for the fact that
there are a number of sections between `&__executable_start` and
the start of the .text section.

Fortunately, those sections are all mapped into the same memory segment
so we only need to look at the next line to find the start of our text
segment.

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

PR-URL: https://github.com/nodejs/node/pull/31547
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
2020-02-01 11:37:47 +01:00
Steffen
d80c40047b
doc: fix numbering
PR-URL: https://github.com/nodejs/node/pull/31575
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-02-01 11:34:26 +01:00
Rusty Conover
0fe810168b doc: clarify socket.setNoDelay() explanation
Change the description of socket.setNoDelay() to make it clear
that sockets have Nagle's algorithm enabled by default.

Better document the tradeoff of having the algorithm enabled.

Explain the behavior of the function based on the passed arguments.

PR-URL: https://github.com/nodejs/node/pull/31541
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-02-01 02:15:44 -08:00
cjihrig
22724894c9
doc: list largepage values in --help
This commit adds the supported --use-largepages values to
the --help menu.

PR-URL: https://github.com/nodejs/node/pull/31537
Fixes: https://github.com/nodejs/node/issues/31533
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-02-01 00:24:50 -05:00
Anna Henningsen
ab9e89439e benchmark: add MessagePort benchmark
Add a raw `MessagePort` benchmark that does not ping back and forth
between different threads, unlike the `echo.js` benchmark, as there
are some performance differences between single-threaded and multi-
threaded operation, and a single-threaded Environment can be somewhat
easier to work with when profiling.

PR-URL: https://github.com/nodejs/node/pull/31568
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-31 19:51:01 -08:00
Dylan Coakley
cb210110e9 test: verify threadId in reports
PR-URL: https://github.com/nodejs/node/pull/31556
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
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: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2020-01-31 19:15:46 -08:00
ConorDavenport
d10927b687 build: ignore all the "Debug","Release" folders
Since there're still many "Debug" and "Release" folders in "deps" and
"tools", to make it more strict and totally ignore the generated obj
files, ignore all the files/folders under them.

Refs: https://github.com/nodejs/node/pull/27210

PR-URL: https://github.com/nodejs/node/pull/31565
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-31 19:13:04 -08:00
Anna Henningsen
023ecbccc8 src: remove preview for heap dump utilities
At least `createHeapSnapshotStream()` and `triggerHeapSnapshot()`
do have side effects, and more importantly, they should not be
run transparently. Without this, typing e.g. `v8.getHeapSnapshot()`
into the REPL will result in a crash or infinite loop while the REPL
evaluates the expression for a preview.

PR-URL: https://github.com/nodejs/node/pull/31570
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-31 19:08:34 -08:00
Denys Otrishko
be6596352b doc: clarify require() OS independence
PR-URL: https://github.com/nodejs/node/pull/31571
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-31 19:05:16 -08:00
Michael Perrotte
54c1a09202 deps: upgrade npm to 6.13.7
PR-URL: https://github.com/nodejs/node/pull/31558
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-31 18:52:20 -08:00
Michael Lumish
470511ae78 doc: add protocol option in http2.connect()
This option is used here:
70c32a6d19/lib/internal/http2/core.js (L3010)

PR-URL: https://github.com/nodejs/node/pull/31560
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-31 18:50:32 -08:00
Harshitha KP
25c3f7c61a test: remove --experimental-worker flag comment
worker is stable in the master branch. The flag is no longer required.

PR-URL: https://github.com/nodejs/node/pull/31563
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-31 18:48:52 -08:00
bcoe
13fe56bbbb
fs: return first folder made by mkdir recursive
mkdir('/foo/bar', { recursive: true }) and mkdirSync will now return
the path of the first folder created. This matches more closely
mkdirp's behavior, and is useful for setting folder permissions.

PR-URL: https://github.com/nodejs/node/pull/31530
Refs: https://github.com/nodejs/node/issues/31481
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-31 11:57:19 -08:00
Gus Caplan
43fb6ffef7
build: enable loading internal modules from disk
PR-URL: https://github.com/nodejs/node/pull/31321
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2020-01-31 01:22:12 -08:00
Tobias Nießen
a171314003 n-api: rename 'promise' parameter to 'value'
This change makes it clear that the value doesn't need to be a
Promise, and makes the signature consistent with other napi_is_*
functions.

PR-URL: https://github.com/nodejs/node/pull/31544
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-30 21:24:11 -08:00
Anna Henningsen
dd4c62eabe doc: clarify that v8.serialize() is not deterministic
Fixes: https://github.com/nodejs/help/issues/2448

PR-URL: https://github.com/nodejs/node/pull/31548
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-01-30 16:35:47 -08:00
Anna Henningsen
abe6a2e3d1 process: report ArrayBuffer memory in memoryUsage()
Report memory allocations performed by the `ArrayBuffer::Allocator`.

PR-URL: https://github.com/nodejs/node/pull/31550
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2020-01-30 16:34:03 -08:00
aaccttrr
9225939528 worker: remove redundant closing of child port
PR-URL: https://github.com/nodejs/node/pull/31555
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-30 16:19:04 -08:00
Richard Lau
d4c81be4a0 doc: update job reference in COLLABORATOR_GUIDE.md
https://ci.nodejs.org/job/node-test-commit-custom-suites/ is disabled
in Jenkins with a note to instead use
https://ci.nodejs.org/job/node-test-commit-custom-suites-freestyle/.
Update the guide to remove the layer of indirection.

PR-URL: https://github.com/nodejs/node/pull/31557
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-30 16:15:45 -08:00
Sam Roberts
38aa31554c doc: simultaneous blog and email of sec announce
PR-URL: https://github.com/nodejs/node/pull/31483
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2020-01-30 14:52:56 -08:00
Robert Nagy
1d9511127c doc: update collaborator guide citgm instructions
PR-URL: https://github.com/nodejs/node/pull/31549
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
2020-01-30 14:24:10 +01:00
Daniel Bevenius
d227d22bd9 src: fix minor typo in base_object.h
PR-URL: https://github.com/nodejs/node/pull/31535
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-30 12:21:40 +01:00
Rich Trott
5cf789e554 test,benchmark: fix test-benchmark-zlib
PR-URL: https://github.com/nodejs/node/pull/31538
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-01-29 19:16:16 -08:00
Tobias Nießen
d65e6a5017 doc: change error message testing policy
Dynamic error messages often contain important information that
depends on the context, e.g., which argument caused an
ERR_INVALID_ARG_TYPE, which type was expected, and which type was
received. I don't think that internal breakage when changing a dynamic
error message should prevent us from testing such properties properly.

PR-URL: https://github.com/nodejs/node/pull/31421
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-29 11:05:02 -04:00
Matteo Collina
24e81d7c5a stream: add regression test for async iteration completion
A test was missing for an async iterator created after the stream
had emitted 'close'. This was regressed by #31314.

See: https://github.com/nodejs/node/pull/31314

PR-URL: https://github.com/nodejs/node/pull/31508
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-01-28 22:22:21 -08:00
Matteo Collina
2cd9892425 Revert "stream: fix async iterator destroyed error propagation"
This reverts commit d15b8ea3bd.

PR-URL: https://github.com/nodejs/node/pull/31508
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-01-28 22:22:19 -08:00
Giovanny Andres Gongora Granada (Gioyik)
64161f2a86 tools: replace deprecated iteritems() for items()
This is a Built-In change in Python 3 used by compile_commands_json.py
to generate compile_commands_json.json. Node.js dropped Python 2 support
in this script, `items()` works as expected replacement.

PR-URL: https://github.com/nodejs/node/pull/31528
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2020-01-28 22:20:34 -08:00
Daniele Belardi
0f8941962d benchmark: use let and const instead of var
Use let and const in domain, es, events, fixtures, fs, http,
http2 and misc.

PR-URL: https://github.com/nodejs/node/pull/31518
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-28 19:59:41 -08:00
Brian White
2170259940 buffer: improve concat() performance
PR-URL: https://github.com/nodejs/node/pull/31522
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-28 19:57:20 -08:00
Rusty Conover
32f63fcf0e src: fix debug crash handling null strings
When internal debug is enabled, output null strings as
"(null)" rather than crashing, matching glibc's behavior.

PR-URL: https://github.com/nodejs/node/pull/31523
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-01-28 19:54:43 -08:00
Denys Otrishko
2462a2c5d7 src: fix ignore GCC -Wcast-function-type for older compilers
Fixes: https://github.com/nodejs/node/issues/31517

PR-URL: https://github.com/nodejs/node/pull/31524
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-28 19:52:30 -08:00
Robert Nagy
b851d7b986 stream: fix finished writable/readable state
writable/readable does not indicate whether as stream is
a Writable/Readable. This implements a better check for
whether a object is a Writable/Readable.

PR-URL: https://github.com/nodejs/node/pull/31527
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-28 19:49:57 -08:00
XhmikosR
70c32a6d19
doc: remove redundant properties from headers
PR-URL: https://github.com/nodejs/node/pull/31492
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-01-28 15:34:17 +00:00
kenzo-spaulding
3d456b1868
doc: update maintaining-V8.md
Updated to conform to style guide.

PR-URL: https://github.com/nodejs/node/pull/31503
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-01-28 15:32:36 +00:00
Justin Ridgewell
f2ec64fbcf
lib: delete dead code in SourceMap
This seems to be a leftover from the chromium project. Nothing uses
`#reverseMappingsBySourceURL`, so constructing it isn't necessary.

PR-URL: https://github.com/nodejs/node/pull/31512
Reviewed-By: Ben Coe <bencoe@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-01-28 15:29:33 +00:00
Brian White
59a1981a22 crypto: improve randomBytes() performance
PR-URL: https://github.com/nodejs/node/pull/31519
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-28 06:56:16 -08:00
legendecas
7b7e7bd185
src,lib: make ^C print a JS stack trace
If terminating the process with ctrl-c / SIGINT, prints a JS stacktrace
leading up to the currently executing code.

The feature would be enabled under option `--trace-sigint`.

Conditions of no stacktrace on sigint:

- has (an) active sigint listener(s);
- main thread is idle (i.e. uv polling), a message instead of stacktrace
  would be printed.

PR-URL: https://github.com/nodejs/node/pull/29207
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Christopher Hiller <boneskull@boneskull.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-28 13:52:27 +08:00
Anna Henningsen
78743f8e39
src: simplify native immediate queue running
Make `SetImmediate()` behave more like `process.nextTick()`
(which matches how we use it) by also running tasks that have been
added during previous `SetImmediate()` calls.

PR-URL: https://github.com/nodejs/node/pull/31502
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
2020-01-27 17:16:42 +00:00
Anna Henningsen
a5d4a397d6
test: make test-http2-buffersize more correct
Previously, this code could have closed the server before the
connection was actually received by the server, as the `'close'`
event on the client side can be emitted before the connection
is established.

The following commit exacerbates this problem, so fix the test first.

PR-URL: https://github.com/nodejs/node/pull/31502
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
2020-01-27 17:16:41 +00:00
bcoe
f2842904c2 fs: bail on permission error in recursive directory creation
When creating directories recursively, the logic should bail
immediately on UV_EACCES and bubble the error to the user.

PR-URL: https://github.com/nodejs/node/pull/31505
Fixes: https://github.com/nodejs/node/issues/31481
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-26 22:32:33 -08:00
Richard Lau
8e245cd4e3
build: build docs in GitHub Actions CI workflow
PR-URL: https://github.com/nodejs/node/pull/31504
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-27 00:38:27 -05:00
Justin Ridgewell
0214b90308 process: fix two overflow cases in SourceMap VLQ decoding
These both have to do with extremely large numbers, so it's unlikely to
cause a problem in practice. Still, correctness.

First, encoding `-2147483648` in VLQ returns the value `"B"`. When
decoding, we get the value `1` after reading the base64. We then check
if the first bit is set (it is) to see if we should negate it, then we
shift all bits right once. Now, `value` will be `0` and `negate` will
be `true`. So, we'd return `-0`. Which is a bug! `-0` isn't
`-2147483648`, and we've broken a round trip.

Second, encoding any number with the 31st bit set, we'd return the
opposite sign. Let's use `1073741824`. Encoding, we get `"ggggggC"`.
When decoding, we get the value `-2147483648` after reading the base64.
Notice, it's already negative (the 32nd bit is set, because the 31st was
set and we shifted everything left once). We'd then check the first bit
(it's not) and shift right. But we used `>>`, which does not shift the
sign bit. We actually wanted `>>>`, which will. Because of that bug, we
get back `-1073741824` instead of the positive `1073741824`. It's even
worse if the 32nd and 31st bits are set, `-1610612736` becomes
`536870912` after a round trip.

I recently fixed the same two bugs in Closure Compiler:
https://github.com/google/closure-compiler/commit/584418eb

PR-URL: https://github.com/nodejs/node/pull/31490
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Coe <bencoe@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
2020-01-26 17:03:39 -08:00
Brian White
59cba9a5c2
buffer: improve fill(number) performance
PR-URL: https://github.com/nodejs/node/pull/31489
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2020-01-26 19:16:05 -05:00
Brian White
886965963a
deps: switch to chromium's zlib implementation
This implementation provides optimizations not included upstream.

PR-URL: https://github.com/nodejs/node/pull/31201
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-01-26 18:47:02 -05:00