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

26115 Commits

Author SHA1 Message Date
cjihrig
c2b180fcbb
test: simplify node-report/test-exception.js
PR-URL: https://github.com/nodejs/node/pull/26277
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2019-02-26 18:15:31 -05:00
cjihrig
9d44950539
test: increase getReport() coverage
PR-URL: https://github.com/nodejs/node/pull/26276
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-26 18:05:38 -05:00
cjihrig
fe8c1f69f2
report: refactor argument validation
PR-URL: https://github.com/nodejs/node/pull/26276
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-26 18:05:30 -05:00
cjihrig
72cf8a3ed6
test: increase triggerReport() coverage
PR-URL: https://github.com/nodejs/node/pull/26268
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-26 17:05:11 -05:00
cjihrig
cae7232e7a
test: consolidate triggerReport() tests
PR-URL: https://github.com/nodejs/node/pull/26268
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-26 17:05:06 -05:00
cjihrig
d64aea0599
report: refactor triggerReport()
This commit fixes the triggerReport() argument validation. The
existing test is also updated, as it was not passing the Error
object to triggerReport().

PR-URL: https://github.com/nodejs/node/pull/26268
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-26 17:04:56 -05:00
cjihrig
e3d4a7d999
inspector: return Error objects on error
The inspector communicates errors via POJOs. This commit
wraps the error information in an actual Error object.

PR-URL: https://github.com/nodejs/node/pull/26255
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-02-26 16:44:47 -05:00
cjihrig
d7a3c3cecc
errors: add ERR_INSPECTOR_COMMAND error
This error is used to propagate errors returned from the
inspector module's command system.

PR-URL: https://github.com/nodejs/node/pull/26255
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-02-26 16:44:34 -05:00
cjihrig
907941d48e
http: validate timeout in ClientRequest()
Validate the timeout option in the ClientRequest() constructor
to prevent asynchronously thrown validation errors.

PR-URL: https://github.com/nodejs/node/pull/26214
Fixes: https://github.com/nodejs/node/issues/26143
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2019-02-26 16:12:54 -05:00
cjihrig
4900863043
url: handle quasi-WHATWG URLs in urlToOptions()
PR-URL: https://github.com/nodejs/node/pull/26226
Refs: https://github.com/nodejs/node/issues/26198
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-02-26 16:04:03 -05:00
Rich Trott
ccd6b12fec tools: update markdown linter
Update remark-preset-lint-node to 1.4.0. This adds `End-Of-Life` as a
prohibited string, favoring `End-of-Life` for consistency.

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

PR-URL: https://github.com/nodejs/node/pull/26281
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-02-25 19:37:38 -08:00
Minwoo Jung
2e125cc2f3 doc: clarify http.ClientRequest path description
Clarify `http.ClientRequest` path description.

Fixes: https://github.com/nodejs/node/issues/25864
PR-URL: https://github.com/nodejs/node/pull/26259
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-02-26 11:04:03 +09:00
Joyee Cheung
bba27a11c5
process: use common operations to define browser globals
Extracts:

- `exposeNamespace`: https://heycam.github.io/webidl/#es-namespaces
- `exposeInterface`: https://heycam.github.io/webidl/#es-interfaces
- `defineOperation`: https://heycam.github.io/webidl/#define-the-operations

into functions to define browser globals.

PR-URL: https://github.com/nodejs/node/pull/26230
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-02-25 16:40:45 +08:00
Rich Trott
79a3348d14 worker: serialize errors if stack getter throws
Current code that is intended to handle the stack getter throwing is
untested. Add a test and adjust code to function as expected.

Co-authored-by: Anna Henningsen <anna@addaleax.net>
PR-URL: https://github.com/nodejs/node/pull/26145
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-02-24 21:27:29 -08:00
Daniel Bevenius
47c784203c src: use smart pointer in UDPWrap::OnSend
PR-URL: https://github.com/nodejs/node/pull/26233
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-25 05:46:25 +01:00
Anna Henningsen
84e02b178a
src: allocate Buffer memory using ArrayBuffer allocator
Always use the right allocator for memory that is turned into
an `ArrayBuffer` at a later point.

This enables embedders to use their own `ArrayBuffer::Allocator`s,
and is inspired by Electron’s electron/node@f61bae3440. It should
render their downstream patch unnecessary.

Refs: f61bae3440

PR-URL: https://github.com/nodejs/node/pull/26207
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2019-02-25 02:01:11 +01:00
Anna Henningsen
6c257cdf27
src: add allocation utils to env
Add a RAII utility for managing blocks of memory that have
been allocated with the `ArrayBuffer::Allocator` for a given
`Isolate`.

PR-URL: https://github.com/nodejs/node/pull/26207
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2019-02-25 02:01:05 +01:00
Anna Henningsen
3767353450
src: add debugging array allocator
Add a subclass of `ArrayBufferAllocator` that performs additional
debug checking, which in particular verifies that:

- All `ArrayBuffer` backing stores have been allocated with this
  allocator, or have been explicitly marked as coming from a
  compatible source.
- All memory allocated by the allocator has been freed once it is
  destroyed.

PR-URL: https://github.com/nodejs/node/pull/26207
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2019-02-25 02:01:03 +01:00
Anna Henningsen
a8ba838e1a
worker: copy transferList ArrayBuffers on unknown allocator
If the `ArrayBuffer::Allocator` used to create `ArrayBuffer`s
in the current `Isolate` is not a Node.js `ArrayBufferAllocator`,
we cannot know that it is `malloc()`-based, an in particular it might
not be compatible with the `ArrayBuffer::Allocator` on the receiving
end of the connection.

PR-URL: https://github.com/nodejs/node/pull/26207
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2019-02-25 02:01:00 +01:00
Anna Henningsen
5c0e18fd40
src: make IsolateData store ArrayBufferAllocator
This enables us to identify whether we are using an
allocator that we know more about than what the generic
`ArrayBuffer::Allocator` API provides, in particular
whether it is `malloc()`-compatible.

PR-URL: https://github.com/nodejs/node/pull/26207
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2019-02-25 02:00:44 +01:00
Anna Henningsen
23b075d051
deps: V8: cherry-pick d3308d0
Original commit message:

    [api] Add `Isolate::GetArrayBufferAllocator()`

    This allows non-monolithic embedders to always allocate memory
    for ArrayBuffer instances using the right allocation method.

    This is based on a patch that Electron is currently using.

    Refs: 1898f91620/patches/common/v8/array_buffer.patch
    Change-Id: I39a614343118a0594aab48699a99cc2aad5b7ba9
    Reviewed-on: https://chromium-review.googlesource.com/c/1462003
    Reviewed-by: Yang Guo <yangguo@chromium.org>
    Commit-Queue: Yang Guo <yangguo@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#59697}

Refs: d3308d042c

PR-URL: https://github.com/nodejs/node/pull/26207
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2019-02-25 02:00:30 +01:00
Joyee Cheung
b0869c64d1
process: move initialization of node-report into pre_execution.js
- Splits signal handler setup code into two functions: one sets up
  `process.on('SIGNAL_NAME')`, another takes care of the signal
  triggers of node-report. Both should only happen on the main thread.
  The latter needs to happen after the node-report configurations
  are read into the process.
- Move the initialization of node-report into pre_execution.js
  because it depends on CLI/environment settings.

PR-URL: https://github.com/nodejs/node/pull/26227
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-02-24 23:41:27 +01:00
Joyee Cheung
34470b0524
process: setup signal handler in prepareMainThreadExecution
Because this is only necessary in the main thread.
Also removes the rearming of signal events since no
signal event handlers should be created during the execution
of node.js now that we've made the creation of stdout and stderr
streams lazy - this has been demonstrated in the test coverage.

PR-URL: https://github.com/nodejs/node/pull/26227
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-02-24 23:41:27 +01:00
Tobias Nießen
7e0ddf66b9 doc: fix deprecation "End-of-Life" capitalization
PR-URL: https://github.com/nodejs/node/pull/26251
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-23 15:15:20 -08:00
Tobias Nießen
8d69fdde19
crypto: fix unencrypted DER PKCS8 parsing
The previously used OpenSSL call only supports encrypted PKCS8,
this commit adds support for unencrypted PKCS8.

PR-URL: https://github.com/nodejs/node/pull/26236
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2019-02-23 13:53:58 +01:00
Tobias Nießen
10c3db3da6
crypto: fix error condition in Verify::VerifyFinal
Fail early if key parsing failed, don't try to construct a context out
of it.

PR-URL: https://github.com/nodejs/node/pull/26238
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-02-23 13:48:41 +01:00
Anna Henningsen
8ebd339031
worker: improve integration with native addons
Allow loading add-ons from multiple Node.js instances if they are
declared context-aware; in particular, this applies to N-API addons.

Also, plug a memory leak that occurred when registering N-API addons.

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

PR-URL: https://github.com/nodejs/node/pull/26175
Fixes: https://github.com/nodejs/node/issues/21481
Fixes: https://github.com/nodejs/node/issues/21783
Fixes: https://github.com/nodejs/node/issues/25662
Fixes: https://github.com/nodejs/node/issues/20239
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2019-02-22 21:42:09 +01:00
cjihrig
455b927be0
test: remove node-report/test-api.js
There does not appear to be any difference between this test
and test/node-report/test-api-nohooks.js.

PR-URL: https://github.com/nodejs/node/pull/26219
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2019-02-22 13:45:16 -05:00
cjihrig
fac40db36e
test: simplify test-api-nohooks.js
PR-URL: https://github.com/nodejs/node/pull/26217
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-22 13:42:02 -05:00
cjihrig
a1d05e49fe
timers: support name in validateTimerDuration()
Allow passing a name to validateTimerDuration() so that error
messages can reflect the name of the thing being validated.

PR-URL: https://github.com/nodejs/node/pull/26215
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-22 13:39:21 -05:00
Richard Lau
4804a18812 build: tidy up comments in create_expfile.sh
Fixes spelling, adds punctuation and rewords some sentences for
readability in the comments of `tools/create_expfile.sh`.

PR-URL: https://github.com/nodejs/node/pull/26220
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-22 12:42:32 -05:00
Tobias Nießen
3d4db3a7bf
doc: fix metadata of DEP0114
PR-URL: https://github.com/nodejs/node/pull/26250
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
2019-02-22 11:43:23 +01:00
gengjiawen
3d2e862e52 src: remove unimplemented method in class StreamPipe
PR-URL: https://github.com/nodejs/node/pull/26202
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-22 05:39:36 +01:00
Ben Noordhuis
9334e45aa0 build: remove mips support
Upstream V8 is dropping support for mips/mipsel/mips64/mips64el.
This commit removes the build flags from the configure script
and some loose ends from the documentation.

PR-URL: https://github.com/nodejs/node/pull/26192
Fixes: https://github.com/nodejs/node/issues/26179
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Yang Guo <yangguo@chromium.org>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-22 05:29:25 +01:00
Rich Trott
eb9e6c0157 test: improve performance of test-crypto-timing-safe-equal-benchmarks
Using `eval()` rather than `require()`'ing a fixture and deleting it
from the cache results in a roughtly 10x improvement in running time.

Fixes: https://github.com/nodejs/node/issues/25984
Refs: https://github.com/nodejs/node/issues/26229

PR-URL: https://github.com/nodejs/node/pull/26237
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yang Guo <yangguo@chromium.org>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2019-02-21 20:22:48 -08:00
Anna Henningsen
d1011f6bbf
src: simplify AliasedBuffer lifetime management
Rely on the V8 garbage collector to take care of managing
the lifetime of the underlying memory of an `AliasedBuffer`.

PR-URL: https://github.com/nodejs/node/pull/26196
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-21 22:22:04 +01:00
ZYSzys
6fb7baf935
buffer: harden validation of buffer allocation size
This makes using `NaN` as the buffer size throw an error.

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

PR-URL: https://github.com/nodejs/node/pull/26162
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-02-21 22:08:53 +01:00
Gireesh Punathil
dbfe14c809 src: make node::SignalWrap::OnSignal into lambda
PR-URL: https://github.com/nodejs/node/pull/26184
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-02-21 20:25:57 +05:30
Anna Henningsen
83e1b97443
http2: shrink memory to match read data
Perform a shrinking `Realloc()` so that less data is
used for HTTP2 reads.

PR-URL: https://github.com/nodejs/node/pull/26201
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2019-02-21 15:39:18 +01:00
Gireesh Punathil
e51da1fcad src: simplify loop arithmetic in GetCPUInfo
Cache the repeated operations and reuse; potentially generating
efficient code in some platforms, and improving readability.

PR-URL: https://github.com/nodejs/node/pull/26183
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-21 08:45:40 +01:00
Ben Noordhuis
24f3f11606 src: move function from header to source file
This particular Buffer::New() overload used to live in node_internals.h
to work around a cyclic header dependency (IIRC) but that is no longer
necessary.

PR-URL: https://github.com/nodejs/node/pull/26173
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-02-21 07:23:30 +01:00
Rich Trott
70b13c28c9 doc: revise deprecation level explanations in Collaborator Guide
Revise deprecation level explanations for scanability and ease of
understanding.

PR-URL: https://github.com/nodejs/node/pull/26197
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-20 22:06:47 -08:00
Ben Noordhuis
042e2640e6 crypto: make ConvertKey clear openssl error stack
Failed ConvertKey() operations should not leave errors on OpenSSL's
error stack because that's observable by subsequent cryptographic
operations. More to the point, it makes said operations fail with
an unrelated error.

PR-URL: https://github.com/nodejs/node/pull/26153
Fixes: https://github.com/nodejs/node/issues/26133
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-21 05:51:32 +01:00
Daniel Bevenius
f17f467544 build,test: guard eslint with crypto check
Currently, configuring --without-ssl will cause the lint-js target to
fail with the following error:
$ make lint-js
Running JS linter...
internal/util.js:101
    throw new ERR_NO_CRYPTO();
    ^

Error [ERR_NO_CRYPTO]:
Node.js is not compiled with OpenSSL crypto support
at assertCrypto (internal/util.js:101:11)
at crypto.js:31:1
...
(/node/tools/node_modules/eslint/node_modules/file-entry-cache/
cache.js:2:14)
at Module._compile (internal/modules/cjs/loader.js:746:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:757:10)
make: *** [lint-js] Error 1

There are also a number of tests that are affected in a similar way.

This commit adds crypto checks to allow for lint-js and the affected
tests to be skipped when configured --without-ssl.

PR-URL: https://github.com/nodejs/node/pull/26182
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-02-21 05:35:12 +01:00
Joyee Cheung
85df2c4703
test: add test for dynamically enabling node.async_hooks tracing
PR-URL: https://github.com/nodejs/node/pull/26062
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-21 10:47:31 +08:00
Joyee Cheung
908e114750
test: add test for node.async_hooks tracing in workers
PR-URL: https://github.com/nodejs/node/pull/26062
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-21 10:47:29 +08:00
Joyee Cheung
c435f069eb
process: simplify the setup of async hooks trace events
- Remove `trace_category_state` from `Environment` - since this is
  only accessed in the bootstrap process and later in the
  trace category update handler, we could just pass the initial
  values into JS land via the trace_events binding, and pass
  the dynamic values directly to the handler later, instead of
  accessing them out-of-band via the AliasedBuffer.
- Instead of creating the hooks directly in
  `trace_events_async_hooks.js`, export the hook factory and
  create the hooks in trace category state toggle.

PR-URL: https://github.com/nodejs/node/pull/26062
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-21 10:47:28 +08:00
Joyee Cheung
435eea6400
src: move async hooks trace events setup to pre_execution.js
Reasons:

- Moves more environment-dependent setup out of bootstrap/node.js
- No async operations should be done before the call to
  the setup functions in pre_execution.js so no async hooks should be
  triggered before that. Therefore it is safe to delay the setup
  until then.

PR-URL: https://github.com/nodejs/node/pull/26062
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-21 10:47:24 +08:00
Jon Kunkee
dec3dadd32 deps: backport ICU fix for ARM64 Windows
ICU 63 as ingested by Node.js does not quite support ARM64 Windows
because its OBJ file IMAGE_FILE_MACHINE_TYPE field logic defaults to
x86 instead of Unknown. This change backports the ICU 64.1 fix for
this.

ICU Issue: https://unicode-org.atlassian.net/browse/ICU-20382
ICU Commit: unicode-org/icu@11e538b

PR-URL: https://github.com/nodejs/node/pull/26090
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-20 19:32:32 -05:00
cjihrig
823c988b48
report: remove verbose setting
This commit removes the --diagnostic-report-verbose CLI option
and all associated logic. The flag is currently only used in one
place, and only reflects the settings at startup. Additionally,
Node tends to use the NODE_DEBUG mechanism for adding verbose
output.

PR-URL: https://github.com/nodejs/node/pull/26195
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-02-20 15:15:57 -05:00