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

27649 Commits

Author SHA1 Message Date
Gabriel Schulhof
8cb4ba982b doc: update js-native-api example
Update example that shows how to separate N-API code which is not
Node.js-specific from code which defines a Node.js N-API addon. In its
existing state the example uses the pattern

```C
assert(napi_*() == napi_ok);
```

However, this would result in no N-API calls when building with
`-DNDEBUG`.

This change moves away from assert and uses a macro `NAPI_CALL()` which
throws the string corresponding to the non-`napi_ok` status as a JS
exception and short-circuits the binding by returning `NULL`.

PR-URL: https://github.com/nodejs/node/pull/28657
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-07-15 19:15:17 -07:00
Anna Henningsen
ef579110cd
doc: add missing version metadata for Readable.from
Fixes: https://github.com/nodejs/node/issues/28693

PR-URL: https://github.com/nodejs/node/pull/28695
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2019-07-15 22:28:36 +02:00
Eugene Ostroukhov
7e543bb2e4 inspector: do not change async call stack depth if the worker is done
Fixes: https://github.com/nodejs/node/issues/28528
PR-URL: https://github.com/nodejs/node/pull/28613
Reviewed-By: Aleksei Koziatinskii <ak239spb@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-07-15 12:32:08 -07:00
cjihrig
440a344f68
doc: small grammar correction
This commit improves the grammar of one sentence in the ESM
documentation.

PR-URL: https://github.com/nodejs/node/pull/28669
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-07-15 13:19:46 -04:00
Rich Trott
0796f0e268 Revert "http: fix test where aborted should not be emitted"
This reverts commit 461bf36d70.

PR-URL: https://github.com/nodejs/node/pull/28699
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2019-07-15 08:40:19 -07:00
Jon Kunkee
c3caf21bd3 deps: cherry-pick 91744bf from node-gyp upstream
This change cherry-picks a small set of node-gyp v5.0.0 changes needed
to enable Node.js ARM64 Windows builds.

Original commit message:
  gyp: add support for Windows on Arm

  Cherry-pick of https://github.com/refack/GYP/pull/33, supersedes
  https://github.com/nodejs/node-gyp/pull/1678 until GYP3 is merged.

  `npm test` passes

  Change-Id: I2b1e1e03e378b4812d34afa527087793864d1576

  PR-URL: https://github.com/nodejs/node-gyp/pull/1739
  Reviewed-By: Refael Ackermann <refack@gmail.com>
  Reviewed-By: João Reis <reis@janeasystems.com>

Refs: 91744bfecc
PR-URL: https://github.com/nodejs/node/pull/28604
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: João Reis <reis@janeasystems.com>
2019-07-15 16:05:41 +01:00
Jon Kunkee
d53144e549 deps: cherry-pick 721dc7d from node-gyp upstream
This change cherry-picks a small set of node-gyp v5.0.0 changes needed
to enable Node.js ARM64 Windows builds.

Original commit message:
  Add ARM64 to MSBuild /Platform logic

  PR-URL: https://github.com/nodejs/node-gyp/pull/1655
  Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
  Reviewed-By: João Reis <reis@janeasystems.com>

Refs: 721dc7d314
PR-URL: https://github.com/nodejs/node/pull/28604
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: João Reis <reis@janeasystems.com>
2019-07-15 16:04:39 +01:00
Jon Kunkee
e984917aaf deps: cherry-pick 13a04aba from V8 upstream
Original commit message:
  fix: move V8_EXPORT_PRIVATE marks to prevent unresolvable references

  This change fixes missing symbol errors in the Windows 10 on ARM build
  of Node.js.

  When a whole class is marked for export, all of its members are marked
  as well. This can be a problem when inline members call undefined yet
  inline members of other classes: the exported function will contain a
  reference to the undefined inline function that should be satisfied at
  link time, but because the other function is inline no symbol will be
  produced that will satisfy that reference.

  Clang gets around this by masking inlined class members from export
  using /Fc:dllexportInlines-. This is why b0a2a567 worked.

  Node.js' Windows builds use MSVC and so do not have access to this
  flag. This results in unresolved symbols at link time.

  Bug: v8:9465
  Change-Id: Ief9c7ab6ba35d22f995939eb62a64d6f1992ed85
  Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1696771
  Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
  Reviewed-by: Jakob Gruber <jgruber@chromium.org>
  Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
  Cr-Commit-Position: refs/heads/master@{#62660}

Refs: 13a04abacd
PR-URL: https://github.com/nodejs/node/pull/28602
Reviewed-By: João Reis <reis@janeasystems.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2019-07-15 15:58:53 +01:00
Ojasvi Monga
11c52d9e9f doc: add documentation for createDiffieHellmanGroup
PR-URL: https://github.com/nodejs/node/pull/28585
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-07-14 23:17:00 -07:00
ZYSzys
6c430b48b9 stream: use readableEncoding public api for child_process
PR-URL: https://github.com/nodejs/node/pull/28548
Refs: https://github.com/nodejs/node/issues/445
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-07-14 22:27:33 -07:00
Robert Nagy
461bf36d70 http: fix test where aborted should not be emitted
PR-URL: https://github.com/nodejs/node/pull/20077
Fixes: https://github.com/nodejs/node/issues/20107
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2019-07-14 21:48:21 -07:00
Ben L. Titzer
2550ddb049
test: increase limit for network space overhead test
This test imposes a limit on the average bytes of space per chunk
for network traffic. However this number depends on VM
implementation details, and upcoming changes to V8's
array buffer management require a small bump to this
limit in this test.

PR-URL: https://github.com/nodejs/node/pull/28492
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-07-15 00:29:19 +02:00
Samuel Attard
056b0bd638
src: add missing option parser template for the DebugOptionsParser
This allows embedders to run `node::options_parser::Parse` for a
`node::DebugOptions`.

PR-URL: https://github.com/nodejs/node/pull/28543
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-07-15 00:26:27 +02:00
Ben Noordhuis
88bac02bee
build: remove broken intel vtune support
Support for VTune profiling was added in commit a881b53 from November
2015 but has since bitrotted. Remove it.

Fixes: https://github.com/nodejs/node/issues/28310
Refs: https://github.com/nodejs/node/pull/3785

PR-URL: https://github.com/nodejs/node/pull/28522
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-07-15 00:25:27 +02:00
Tariq Ramlall
d0e380172a
src: lint #defines in src/node.h
A few #defines in src/node.h had inconsistent spacing
and tabbing. This commit changes the spacing to be
the same style as the rest of the project.

PR-URL: https://github.com/nodejs/node/pull/28547
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2019-07-15 00:22:56 +02:00
Weijia Wang
824dc576db
stream: simplify .pipe() and .unpipe() in Readable
Now we are using `pipes` and `pipesCount` in Readable state and the
`pipes` value can be a stream or an array of streams. This change
reducing them into one `pipes` value, which is an array of streams.

PR-URL: https://github.com/nodejs/node/pull/28583
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-07-15 00:19:51 +02:00
Ben Noordhuis
5bed327a34
test: fix pty test hangs on aix
Some pty tests persistently hung on the AIX CI buildbots. Fix that by
adding a helper script that properly sets up the pty before spawning
the script under test.

On investigation I discovered that the test runner hung when it tried
to close the slave pty's file descriptor, probably due to a bug in
AIX's pty implementation. I could reproduce it with a short C program.
The test runner also leaked file descriptors to the child process.

I couldn't convince python's `subprocess.Popen()` to do what I wanted
it to do so I opted to move the logic to a helper script that can do
fork/setsid/etc. without having to worry about stomping on state in
tools/test.py.

In the process I also uncovered some bugs in the pty module of the
python distro that ships with macOS 10.14, leading me to reimplement
a sizable chunk of the functionality of that module.

And last but not least, of course there are differences between ptys
on different platforms and the helper script has to paper over that.
Of course.

Really, this commit took me longer to put together than I care to admit.

Caveat emptor: this commit takes the hacky ^D feeding to the slave out
of tools/test.py and puts it in the *.in input files. You can also feed
other control characters to tests, like ^C or ^Z, simply by inserting
them into the corresponding input file. I think that's nice.

Fixes: https://github.com/nodejs/build/issues/1820
Fixes: https://github.com/nodejs/node/issues/28489

PR-URL: https://github.com/nodejs/node/pull/28600
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-07-15 00:12:38 +02:00
Xu Meng
d0b0230e7d
build,v8: support IBM i
Some libraries do not exist on IBM i (OS400).
Commit 417c18e introduces these missing libraries.
Need to differentiate `AIX` and `OS400`(IBM i).

PR-URL: https://github.com/nodejs/node/pull/28607
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2019-07-15 00:11:04 +02:00
Lucas Holmquist
ebe92611fc
tools: add coverage to ignored files
This adds the coverage directory to the .gitignore file.

PR-URL: https://github.com/nodejs/node/pull/28626
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Masashi Hirano <shisama07@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-07-15 00:09:05 +02:00
Anna Henningsen
57c70835af
http2: report memory allocated by nghttp2 to V8
This helps the JS engine have a better understanding of the memory
situation in HTTP/2-heavy applications, and avoids situations that
behave like memory leaks due to previous underestimation of memory
usage which is tied to JS objects.

Refs: https://github.com/nodejs/node/issues/28088#issuecomment-509965105

PR-URL: https://github.com/nodejs/node/pull/28645
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-07-15 00:07:19 +02:00
Michaël Zasso
60a207f5f2
deps: update acorn to 6.2.0
Includes support for bigint syntax so we can remove the acorn-bigint
plugin.

PR-URL: https://github.com/nodejs/node/pull/28649
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
2019-07-15 00:04:50 +02:00
Anna Henningsen
00464b5282
src: add cleanup hook for ContextifyContext
Otherwise there’s a memory leak left by the context when the Isolate
tears down without having run the weak callback.

PR-URL: https://github.com/nodejs/node/pull/28631
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2019-07-14 23:23:33 +02:00
Anna Henningsen
518ffc1256
zlib: do not coalesce multiple .flush() calls
This is an approach to address the issue linked below. Previously,
when `.write()` and `.flush()` calls to a zlib stream were interleaved
synchronously (i.e. without waiting for these operations to finish),
multiple flush calls would have been coalesced into a single flushing
operation.

This patch changes behaviour so that each `.flush()` all corresponds
to one flushing operation on the underlying zlib resource, and the
order of operations is as if the `.flush()` call were a `.write()`
call.

One test had to be removed because it specifically tested the previous
behaviour.

As a drive-by fix, this also makes sure that all flush callbacks are
called. Previously, that was not the case.

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

PR-URL: https://github.com/nodejs/node/pull/28520
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-07-14 22:40:12 +02:00
Gabriel Schulhof
efc39464b0 doc: mark N-API thread-safe function stable
The various TSFN APIs are marked as stable, but the TSFN heading itself
is still marked as experimental.

PR-URL: https://github.com/nodejs/node/pull/28643
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-07-14 11:49:35 -07:00
cjihrig
febdf39fdf
doc: mark process.report as experimental
Everything under process.report is experimental. This commit
adds the missing stability index entries.

PR-URL: https://github.com/nodejs/node/pull/28653
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2019-07-14 10:09:58 -04:00
Ruben Bridgewater
e12f48ef07 path: move branch to the correct location
This code branch only makes sense when i === length. Otherwise it'll
already be handled.

PR-URL: https://github.com/nodejs/node/pull/28556
Fixes: https://github.com/nodejs/node/issues/28549
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
2019-07-14 10:47:10 +08:00
Ruben Bridgewater
5a6aa66afa path: using .relative() should not return a trailing slash
Resolving a path against root with `path.relative()` should not
include a trailing slash.

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

PR-URL: https://github.com/nodejs/node/pull/28556
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
2019-07-14 10:46:53 +08:00
cjihrig
c31f7e595a
readline: expose stream API in clearScreenDown()
This commit adds an optional callback to clearScreenDown(),
which is passed to the stream's write() method. It also
exposes the return value of write().

PR-URL: https://github.com/nodejs/node/pull/28641
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-07-13 16:20:06 -04:00
Rich Trott
a013aa0f5e doc: remove superfluous MDN link in assert.md
PR-URL: https://github.com/nodejs/node/pull/28246
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-07-13 10:06:05 -07:00
cjihrig
a13054549e
readline: simplify isFullWidthCodePoint()
The non-ICU-based isFullWidthCodePoint() can be simplified to
a single `return` statement. This commit removes the extra
branching logic.

PR-URL: https://github.com/nodejs/node/pull/28640
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2019-07-13 11:40:09 -04:00
cjihrig
223ba43434
readline: remove IIFE in SIGCONT handler
This commit removes an IIFE in the readline SIGCONT handler
that was previously being used to bind `this`.

PR-URL: https://github.com/nodejs/node/pull/28639
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2019-07-13 10:26:06 -04:00
cjihrig
5af9f15fd8
readline: use named constant for surrogate checks
This commit defines a named constant instead of using a mix of
2 ** 16 and 0x10000 throughout the code.

PR-URL: https://github.com/nodejs/node/pull/28638
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2019-07-13 10:14:22 -04:00
cjihrig
ec5518003f
doc: drop 'for more details' in deprecations
The deprecations documentation links to the GitHub issue
tracker in several places. This commit makes the text
around those links consistent.

PR-URL: https://github.com/nodejs/node/pull/28617
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-07-13 10:08:35 -04:00
cjihrig
2c5716bd72
src: simplify --debug flags
Any use of --debug, --debug=, --debug-brk, or --debug-brk=
now triggers an error. That means we can eliminate their
aliases with --inspect counterparts and simplify the code.

PR-URL: https://github.com/nodejs/node/pull/28615
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2019-07-13 09:57:54 -04:00
Walle Cyril
84ad92d2e7 doc: add example on how to create __filename, __dirname for esm
PR-URL: https://github.com/nodejs/node/pull/28282
Fixes: https://github.com/nodejs/node/issues/28114
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-07-13 15:46:06 +02:00
GauthamBanasandra
cf929c04b0 src, tools: replace raw ptr with smart ptr
NodeMainInstance::Create will now returrn
an instance of NodeMainInstance in a
unique_ptr.

PR-URL: https://github.com/nodejs/node/pull/28577
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-07-12 21:59:36 -07:00
Juan José Arboleda
9c4bdfe9b2 src: replace already elevated Object, Local v8 namespace
PR-URL: https://github.com/nodejs/node/pull/28611
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-07-12 21:33:56 -07:00
Christopher Hiller
bff7a46f31
report: modify getReport() to return an Object
It's likely that anyone using `process.report.getReport()` will be
processing the return value thereafter (e.g., filtering fields or
redacting secrets). This change eliminates boilerplate by calling
`JSON.parse()` on the return value.

Also modified the `validateContent()` and `validate()` test helpers in
`test/common/report.js` to be somewhat more obvious and helpful. Of
note, a report failing validation will now be easier (though still not
_easy_) to read when prepended to the stack trace.

- Refs: https://github.com/nodejs/diagnostics/issues/315

PR-URL: https://github.com/nodejs/node/pull/28630
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-07-12 14:48:09 -07:00
Luigi Pinca
28e18cfff0 doc: add missing types
Document the types returned by the `readable.readableObjectMode`,
`writable.writableLength`, and `writable.writableObjectMode` getters.

PR-URL: https://github.com/nodejs/node/pull/28623
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-07-12 14:35:35 -07:00
Tobias Nießen
9e340357df doc: relax requirements for setAAD in CCM mode
This was fixed in OpenSSL 1.1.1c (openssl/openssl@b48e3be947). The
authentication tag can now be specified after setAAD was called,
matching the behavior of the other supported AEAD modes (GCM, OCB).

Refs: https://github.com/openssl/openssl/pull/7243

PR-URL: https://github.com/nodejs/node/pull/28624
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-07-12 14:34:16 -07:00
Lucas Holmquist
d38b075dd4 doc: add a link to the throw-deprecations flag
Motivation:  On the deprecated api's doc, the --pending-deprecation flag
is a clickable link to the command line docs.

This makes the --throw-deprecation flag, which is described in the next
paragraph also a link to keep things consistent

PR-URL: https://github.com/nodejs/node/pull/28625
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-07-12 14:33:01 -07:00
Michaël Zasso
a8ed416ead
build: do not always build the default V8 snapshot
It should be skipped if Node.js is built with the --without-snapshot
configure flag.

PR-URL: https://github.com/nodejs/node/pull/28467
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-07-12 16:31:41 +02:00
cjihrig
641d57fc0a
src: manage MakeContext() pointer with unique_ptr
PR-URL: https://github.com/nodejs/node/pull/28616
Refs: https://github.com/nodejs/node/pull/28452
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-07-12 09:07:23 -04:00
David Carlier
fe1b96d460 src: clang build warning fix
fix UB with string concatenations. += operator makes things
clearer for compiler's perspective.

PR-URL: https://github.com/nodejs/node/pull/28480
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-07-11 23:20:24 -07:00
Vse Mozhet Byt
1cc5c547d5 doc: fix nits in stream.md
* Unify periods and upper case in comments.
* Add missing parentheses for methods.
* Add missing backticks.
* Fix sorting position of `writable.writableFinished` section.
* Replace a one-letter variable with a more readable one.
* `catch(console.log)` -> `catch(console.error)`.
* Document missing `emitClose` option in `new stream.Readable()` section
  mentioned in https://nodejs.org/api/stream.html#stream_event_close_1
  and https://nodejs.org/api/stream.html#stream_readable_destroy_error
  copying from the `new stream.Writable()` section.
  Refs: 36fdf1aa6c/lib/_stream_readable.js (L121)

PR-URL: https://github.com/nodejs/node/pull/28591
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2019-07-11 23:01:08 -07:00
Rich Trott
86f8f4f791 doc: edit stream module introduction
Edit the stream module introduction for concision and simplicity.

PR-URL: https://github.com/nodejs/node/pull/28595
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2019-07-11 22:57:09 -07:00
Rich Trott
4276066395 tools: add markdown lint rule for 'Unix'
A recent PR standardized on 'Unix' rather than 'UNIX' or 'unix'. This
change adds a markdown linting rule to enforce it going forward.

PR-URL: https://github.com/nodejs/node/pull/28619
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-07-11 22:42:21 -07:00
Rich Trott
f428f47636 doc: change 'unix' to 'Unix' in ninja guide
A recent PR converted all instances of 'unix' and 'UNIX' to 'Unix'
in the API docs. This commit fixes one instance in the guides in
preparation for a relevant lint rule.

PR-URL: https://github.com/nodejs/node/pull/28619
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-07-11 22:42:19 -07:00
Tim Baverstock
7008d783c8 doc: add line for inspect host:port invocation
PR-URL: https://github.com/nodejs/node/pull/28405
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2019-07-11 20:40:08 -07:00
vmarchaud
0ebf01dc53
perf_hooks: add HttpRequest statistics monitoring #28445
```js
const { PerformanceObserver, performance } = require('perf_hooks');
const http = require('http');

const obs = new PerformanceObserver((items) => {
  const entry = items.getEntries()[0];
  console.log(entry.name, entry.duration);
});
obs.observe({ entryTypes: ['http'] });

const server = http.Server(function(req, res) {
  server.close();
  res.writeHead(200);
  res.end('hello world\n');
});

server.listen(0, function() {
  const req = http.request({
    port: this.address().port,
    path: '/',
    method: 'POST'
  }).end();
});
```

PR-URL: https://github.com/nodejs/node/pull/28486
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-07-12 00:36:27 +02:00