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

25225 Commits

Author SHA1 Message Date
Joyee Cheung
a29c93a147
src: move the declaration of http parser versions into node_metadata.h
Instead of putting them in node_internals.h.

PR-URL: https://github.com/nodejs/node/pull/25115
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-21 07:46:30 +08:00
Joyee Cheung
e9703619e0
src: move GetOpenSSLVersion into node_metadata.cc
Instead of implementing it in node_crypto.cc even though the only
place that needs it is the `Metadata::Versions` constructor.

PR-URL: https://github.com/nodejs/node/pull/25115
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-21 07:46:28 +08:00
cjihrig
3438f4b2ca
os: use uv_os_gethostname() in hostname()
This commit changes the C++ implementation of os.hostname()
to use uv_os_gethostname().

PR-URL: https://github.com/nodejs/node/pull/25111
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-20 13:44:28 -05:00
cjihrig
9ac108d834
http: add maxHeaderSize property
This commit exposes the value of --max-http-header-size
as a property of the http module.

PR-URL: https://github.com/nodejs/node/pull/24860
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-20 13:15:07 -05:00
Michaël Zasso
f0e460968e
deps: remove test-related GYP files
- Less files to maintain.
- We don't use them.
- We build with GN to run V8 tests.

Fixes: https://github.com/nodejs/node/issues/25095
Refs: https://github.com/nodejs/node/issues/25010

PR-URL: https://github.com/nodejs/node/pull/25097
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
2018-12-20 16:57:43 +01:00
cjihrig
632f263324
cli: add --max-http-header-size flag
Allow the maximum size of HTTP headers to be overridden from
the command line.

co-authored-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/24811
Fixes: https://github.com/nodejs/node/issues/24692
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2018-12-20 09:31:52 -05:00
Matteo Collina
436f4de38f
src: add kUInteger parsing
This commit adds support for uint64_t option parsing.

PR-URL: https://github.com/nodejs/node/pull/24811
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2018-12-20 09:31:52 -05:00
cjihrig
cdcb1b7737
deps: cherry-pick http_parser_set_max_header_size
This commit adds http_parser_set_max_header_size() to the
http-parser for overriding the compile time maximum HTTP
header size.

PR-URL: https://github.com/nodejs/node/pull/24811
Fixes: https://github.com/nodejs/node/issues/24692
Refs: https://github.com/nodejs/http-parser/pull/453
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2018-12-20 09:31:51 -05:00
Ruben Bridgewater
d4c91f2814
lib: remove internal util._extends() usage
This removes all internal calls to the deprecated `_extends()`
function. It is slower than `Object.assign()` and the object spread
notation since V8 6.8 and using the spread notation often also
results in shorter code.

PR-URL: https://github.com/nodejs/node/pull/25105
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: Luigi Pinca <luigipinca@gmail.com>
2018-12-20 13:52:44 +01:00
Ruben Bridgewater
4b7a530f2b
lib: switch to object spread where possible
Use the object spread notation instead of using Object.assign.
It is not only easier to read it is also faster as of V8 6.8.

PR-URL: https://github.com/nodejs/node/pull/25104
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-12-20 13:14:46 +01:00
Gireesh Punathil
6f8ccef74e src: port GetLoadedLibraries for freebsd
the dl_iterate_phdr and its associated data structure in Linux
are fully available in freebsd as well, so opening it up for
freebsd means just opening up the platform specific identifiers.

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

PR-URL: https://github.com/nodejs/node/pull/25106
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-12-20 12:16:11 +05:30
Anna Henningsen
6b7816e22b src: mark options parsers as const
These do not change their contents after being constructed.

PR-URL: https://github.com/nodejs/node/pull/25065
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-20 07:23:55 +01:00
ZYSzys
e5966ef60c vm: reuse validateString of internal/validators
PR-URL: https://github.com/nodejs/node/pull/25074
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2018-12-20 05:37:58 +01:00
briete
937c7695aa os: move process.binding('os') to internalBinding
PR-URL: https://github.com/nodejs/node/pull/25087
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-20 05:29:16 +01:00
Gabriel Schulhof
13abc6adfb src: unload addons when environment quits
This is an alternative to https://github.com/nodejs/node/pull/23319
which attaches the loaded addons to the environment and closes them
when the environment is destroyed.

PR-URL: https://github.com/nodejs/node/pull/24861
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-12-19 18:35:38 -08:00
Anna Henningsen
622e348d8f test,doc: add tests and docs for addon unloading
Originally from portions of https://github.com/nodejs/node/pull/23319/.

PR-URL: https://github.com/nodejs/node/pull/24861
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-12-19 18:34:28 -08:00
cjihrig
bf36f0755c
console: improve inspectOptions validation
This commit adds stricter type checking to the inspectOptions
option to the Console constructor.

PR-URL: https://github.com/nodejs/node/pull/25090
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-19 12:19:01 -05:00
Anna Henningsen
67f95825e5
src: handle empty Maybe in uv binding initialize
This can fail when terminating a Worker that loads
the `uv` binding at the same time.

Refs: https://github.com/nodejs/node/pull/25061#issuecomment-447648475
Fixes: https://github.com/nodejs/node/issues/25134
PR-URL: https://github.com/nodejs/node/pull/25079
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-12-19 17:31:06 +01:00
Ruben Bridgewater
a76750b49e
events: simplify stack compare function
This simplifies the `longestSeqContainedIn()` logic by checking for
the first identical occurance of at least three frames instead of
the longest one.
It also removes an unused argument.

PR-URL: https://github.com/nodejs/node/pull/24744
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-12-19 17:12:00 +01:00
cjihrig
35a8906964
test: remove obsolete eslint comments
The surrounding code was updated, making these eslint-disable
comments obsolete.

PR-URL: https://github.com/nodejs/node/pull/25088
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-19 11:04:24 -05:00
Ruben Bridgewater
240065fd8b
test: verify input flags
This makes sure all required flags are passed through to the test.
If that's not the case an error is thrown to inform the user what
flag is missing.

PR-URL: https://github.com/nodejs/node/pull/24876
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2018-12-19 16:35:41 +01:00
Ruben Bridgewater
0f58ae392b
util: format() now formats bigint and booleans
This is necessary to distinguish them from other data types.

PR-URL: https://github.com/nodejs/node/pull/25046
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
2018-12-19 16:31:11 +01:00
cjihrig
728b155870
deps: upgrade to libuv 1.24.1
PR-URL: https://github.com/nodejs/node/pull/25078
Fixes: https://github.com/nodejs/node/issues/24521
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2018-12-19 09:02:22 -05:00
Anna Henningsen
e1ab457490 worker: fix nullptr deref after MessagePort deser failure
This would previously always have crashed when deserializing
a `MessagePort` fails, because there was always at least one
`nullptr` entry in the vector.

PR-URL: https://github.com/nodejs/node/pull/25076
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2018-12-19 05:30:31 +01:00
Rich Trott
dbdfc5d656 test: add signal check to test-esm-cjs-main
PR-URL: https://github.com/nodejs/node/pull/25073
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-18 14:39:16 -08:00
Joyee Cheung
eef6504cf7 src: schedule destroy hooks in BeforeExit early during bootstrap
Instead of doing it in the `internalBinding('async_wrap')`
initialization whose first call is uncertain depending on how
the native modules are loaded in JS land during bootstrap.

PR-URL: https://github.com/nodejs/node/pull/25020
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-12-18 10:56:49 -08:00
Joyee Cheung
321e296371
process: move POSIX credential accessors into node_credentials.cc
Expose the POSIX credential accessors through
`internalBinding('credentials')` instead of setting them on the
process or bootstrapper object from C++ directly. Also moves
`SafeGetEnv` from `internalBinding('util')` to
`internalBinding('credentials')` since it's closely related to
the credentials.

In the JS land, instead of wrapping the bindings then writing
to the process object directly in main_thread_only.js, return
the wrapped functions back to bootstrap/node.js where they get
written to the process object conditionally for clarity.

Refs: https://github.com/nodejs/node/issues/24961

PR-URL: https://github.com/nodejs/node/pull/25066
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-19 02:44:03 +08:00
Beth Griggs
74a1dfb56e
2018-12-18, Version 11.5.0 (Current)
Notable changes:

* **tls**:
  * support "BEGIN TRUSTED CERTIFICATE" for ca: (Sam Roberts)
    [#24733](https://github.com/nodejs/node/pull/24733)
* **util**:
  * add inspection getter option (Ruben Bridgewater)
    [#24852](https://github.com/nodejs/node/pull/24852)

PR-URL: https://github.com/nodejs/node/pull/25102
2018-12-18 18:36:17 +00:00
Beth Griggs
1cbd377078
2018-12-18, Version 8.14.1 'Carbon' (LTS)
Notable changes:

* **assert**:
  - revert breaking change (Ruben Bridgewater)
    [#24786](https://github.com/nodejs/node/pull/24786)
* **http2**:
  - fix sequence of error/close events (Gerhard Stoebich)
    [#24789](https://github.com/nodejs/node/pull/24789)

PR-URL: https://github.com/nodejs/node/pull/24832
2018-12-18 11:29:17 -05:00
Anna Henningsen
3b9e0f2a0a
zlib: split JS code as prep for non-zlib-backed streams
Split the `Zlib` class into `ZlibBase` and `Zlib` classes,
to facilitate introduction of similar streams with minor
implementation differences.

PR-URL: https://github.com/nodejs/node/pull/24939
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2018-12-18 16:24:37 +01:00
Rich Trott
3ccb900e0c test: add missing tmpdir.refresh() in recently-added test
Without `tmpdir.refresh()`, the test fails in some situations. This was
missed because using `test.py` will almost always result in a leftover
tmpdir lying around that makes the `refresh()` not needed.

Refs: https://github.com/nodejs/node/pull/24913#issuecomment-447982921

PR-URL: https://github.com/nodejs/node/pull/25098
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
2018-12-18 07:13:32 -08:00
Ruben Bridgewater
3b2698e41f
assert: inspect getters
While asserting two objects the descriptor is not taken into account.
Therefore getters will be triggered as such. This makes sure they
are also highlighted in the error message instead of potentially
looking identical while the return value of the getter is actually
different.

PR-URL: https://github.com/nodejs/node/pull/25004
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2018-12-18 12:34:08 +01:00
Joyee Cheung
0858e5d9d8
src: always compile and store code cache for native modules
This patch changes the NativeModuleLoader to always try to find
code cache for native modules when it compiles them, and always
produce and store the code cache after compilation. The cache
map is protected by a mutex and can be accessed by different
threads - including the worker threads and the main thread. Hence any
thread can reuse the code cache if the native module has already
been compiled by another thread - in particular the cache of the
bootstrappers and per_context.js will always be hit when a new thread
is spun.

This results in a ~6% startup overhead in the worst case
(when only the main thread is launched without requiring any additional
native module - it now needs to do the extra work of finding and
storing caches), which balances out the recent improvements by moving
the compilation to C++, but it also leads to a ~60% improvement in
the best case (when a worker thread is spun and requires a lot of native
modules thus hitting the cache compiled by the main thread).

PR-URL: https://github.com/nodejs/node/pull/24950
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-12-18 18:02:11 +08:00
Joyee Cheung
ceb6635223
src: remove code cache integrity check
In preparation of sharing code cache among different threads -
we simply rely on v8 to reject invalid cache, since there isn't
any serious consequence when the cache is invalid anyway.

PR-URL: https://github.com/nodejs/node/pull/24950
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-12-18 18:02:08 +08:00
ZYSzys
8828426af4 test: test internal/util/types in vm
PR-URL: https://github.com/nodejs/node/pull/25056
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-12-18 05:24:45 +01:00
Joyee Cheung
9190e4ecdf tools: make apilinks building more robust
1. Move the apilinks.json file into out/doc so it gets cleaned when
  running `make docclean`
2. When the apilinks.json generated is empty, throw a specific error
  so it's easier to understand what's wrong
3. Write to a file passed through CLI arguments instead writing to
  stdout in apilinks.js so the build process is more robust in
  the case of a bad binary

PR-URL: https://github.com/nodejs/node/pull/25019
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-18 05:14:24 +01:00
Rich Trott
3edc1c917b doc: revise "Breaking Changes" section of Collaborator Guide
Simplify material about TSC approval for breaking changes. Omit
extraneous material explaining that purely additive changes are not
breaking changes.

PR-URL: https://github.com/nodejs/node/pull/25071
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-17 18:49:27 -08:00
Joyee Cheung
19a9205645 process: move environment variable proxy code into node_env_var.cc
Instead of exposing all the NamedPropertyHandlerConfiguration()
parameters in node_internals, simply expose a CreateEnvVarProxy()
method that returns a Local<Value> that implements process.env,
and mark all the property handlers static in node_env_var.cc.
This makes the code more encapsulated.

PR-URL: https://github.com/nodejs/node/pull/25067
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-17 16:21:25 -08:00
Rich Trott
47ecf20603 test: remove magic numbers in test-gc-http-client-onerror
Remove magic numbers (500, 10, 100) from the test. Instead, detect when
GC has started and stop sending requests at that point.

On my laptop, this results in 16 or 20 requests per run instead of 500.

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

PR-URL: https://github.com/nodejs/node/pull/24943
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-12-17 15:21:43 -08:00
Jon Moss
4b96a2a73b src: extract common Bind method
`TCPWrap::Bind` and `TCPWrap::Bind6` share a large amount of
functionality, so a common `Bind` was extracted to remove duplication.

PR-URL: https://github.com/nodejs/node/pull/22315
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
2018-12-17 16:40:39 -05:00
cjihrig
928f776385 doc: add missing pr-url
PR-URL: https://github.com/nodejs/node/pull/25091
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2018-12-17 11:29:35 -08:00
Sam Roberts
19b59bfe17 tls: re-define max supported version as 1.2
Several secureProtocol strings allow any supported TLS version as the
maximum, but our maximum supported protocol version is TLSv1.2 even if
someone configures a build against an OpenSSL that supports TLSv1.3.

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

PR-URL: https://github.com/nodejs/node/pull/25024
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-12-17 09:00:27 -08:00
Ruben Bridgewater
50dd555910
doc,lib,test: capitalize comment sentences
This activates the eslint capitalize comment rule for comments
above 50 characters.

PR-URL: https://github.com/nodejs/node/pull/24996
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-17 17:14:35 +01:00
Ruben Bridgewater
be3ae33936
console: add inspectOptions option
Add an `inspectOptions` option to the `console` constructor. That
way it's possible to define all inspection defaults for each
`console` instance instead of relying on the `inspect()` defaults.

PR-URL: https://github.com/nodejs/node/pull/24978
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
2018-12-17 16:42:36 +01:00
Daniel Bevenius
a361b94b78 build: add a space to clarify skipping crypto msg
This commit adds a space to the message that is displayed for tests that
are skipped when node was built --without-ssl. For example, this is what
is currently displayed:
"release test-https-agent-additional-optionsSkipping as node was
compiled without crypto support"

After this change this will be:
"release test-https-agent-additional-options: Skipping as node was
compiled without crypto support"

PR-URL: https://github.com/nodejs/node/pull/25011
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-12-17 10:35:24 +01:00
Sam Roberts
b54d4a68e3 test: merge test with unnecessary child process
Test didn't require child process creation. While this test has not been
unstable, child process creation is slower and can be flaky in ci, so
test directly for the segfault regression.

PR-URL: https://github.com/nodejs/node/pull/25025
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-12-16 21:29:15 -08:00
Ruben Bridgewater
3439c955ab process: improve --redirect-warnings handling
1) Acquiring the file descriptor is not observable anymore when using
   the `--redirect-warnings` flag.
2) If `fs.appendFile` fails, the warning is now redirected to the
   default output.
3) The code is smaller and simpler.

PR-URL: https://github.com/nodejs/node/pull/24965
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-17 05:37:55 +01:00
cjihrig
707b0a8534 tools: enable no-useless-constructor lint rule
This commit enables ESLint's no-useless-constructor rule. Note
that the documentation examples that only include constructor
calls were left in tact.

PR-URL: https://github.com/nodejs/node/pull/25055
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-16 20:30:50 -08:00
Anna Henningsen
18f2bf7f9b src: mark some global state as const
Mark some global variables as `const` or `constexpr`.

PR-URL: https://github.com/nodejs/node/pull/25052
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-16 20:21:45 -08:00
cjihrig
52ee55a06b vm: simplify Script constructor options validation
This commit combines two related if statements into an
if-else statement.

PR-URL: https://github.com/nodejs/node/pull/25054
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-12-16 20:14:56 -08:00