0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 07:27:22 +01:00
Commit Graph

24436 Commits

Author SHA1 Message Date
cjihrig
39a027224e
assert: remove unused catch bindings
PR-URL: https://github.com/nodejs/node/pull/24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>
2018-11-06 10:58:42 -05:00
cjihrig
9d68e56856
fs: remove unused catch bindings
PR-URL: https://github.com/nodejs/node/pull/24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>
2018-11-06 10:58:30 -05:00
Masashi Hirano
a49b672aad doc: add shisama to collaborators
PR-URL: https://github.com/nodejs/node/pull/24136
Fixes: https://github.com/nodejs/node/issues/23850
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2018-11-07 00:20:38 +09:00
Refael Ackermann
bec505bed7 build,meta: don't fail Travis for commit message
PR-URL: https://github.com/nodejs/node/pull/23739
Fixes: https://github.com/nodejs/node/issues/23737
Refs: https://github.com/nodejs/node/pull/22452
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
2018-11-06 09:38:47 -05:00
Antoine du Hamel
0f63d84f80 crypto: set DEFAULT_ENCODING property to non-enumerable
Since it is a deprecated API, a deprecation warning is printed when
loading crypto module from ESM. Making it non enumerable remove the
deprecation warning and make the API non-available to named imports.

PR-URL: https://github.com/nodejs/node/pull/23222
Fixes: https://github.com/nodejs/node/issues/23203
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2018-11-06 16:30:26 +02:00
Joyee Cheung
5850220229
src: move error handling code into node_errors.cc
Move the following code into a new node_errors.cc file and
declare them in node_errors.h for clarity and make it possible
to include them with node_errors.h.

- AppendExceptionLine()
- DecorateErrorStack()
- FatalError()
- OnFatalError()
- PrintErrorString()
- FatalException()
- ReportException()
- FatalTryCatch

And move the following definitions (declared elsewhere than
node_errors.h) to node_errors.cc:

- Abort() (in util.h)
- Assert() (in util.h)

PR-URL: https://github.com/nodejs/node/pull/24058
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2018-11-06 20:58:40 +08:00
Ben Noordhuis
7b1297d856
deps: c-ares float, version number patch
Not yet upstream.

Refs: https://github.com/c-ares/c-ares/issues/229

PR-URL: https://github.com/nodejs/node/pull/23854
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-11-06 11:29:22 +00:00
Ben Noordhuis
3a25b174aa
deps: upgrade to c-ares v1.15.0
Our out-of-tree patch from 2b6bb9f588 ("deps: c-ares float, win ipv6 bad
fec0 prefix") should no longer be necessary, c-ares now blacklists such
addresses itself.

PR-URL: https://github.com/nodejs/node/pull/23854
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-11-06 11:29:22 +00:00
Ben Noordhuis
50f951c90f
deps: remove old c-ares configure files
Remove leftover files that were added in commit 58e4edaf68 from 2013
to help with standalone builds of the c-ares fork that we maintained
at the time.

PR-URL: https://github.com/nodejs/node/pull/23854
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-11-06 11:29:22 +00:00
Ouyang Yadong
aa82a21c3a
test: add a test for tls.Socket with allowHalfOpen
This test ensures that a tls client socket using `StreamWrap` with
`allowHalfOpen` option won't hang.

PR-URL: https://github.com/nodejs/node/pull/23866
Refs: https://github.com/nodejs/node/pull/23654
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-11-06 11:16:39 +00:00
Rich Trott
441555866b doc: implement minor text fixes to path.md
posix -> POSIX
platform specific -> platform-specific

PR-URL: https://github.com/nodejs/node/pull/24118
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2018-11-05 23:21:45 -08:00
Vladimir de Turckheim
278086a387 vm: clarify timeout option in vm
This updates the documentation
to clarify how to use `timeout`
in the vm module.

PR-URL: https://github.com/nodejs/node/pull/23512
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-11-05 22:39:01 -08:00
Сковорода Никита Андреевич
90be286034 doc: inspector security warning for changing host
Refs: https://github.com/nodejs/node/issues/23444
Refs: https://github.com/nodejs/node/issues/21774

PR-URL: https://github.com/nodejs/node/pull/23640
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
2018-11-05 22:38:01 -08:00
Rich Trott
54e29221c3 doc: fix minor text issues in stream.md
Implement several minor grammar, punctuation, and style fixes in
stream.md.

PR-URL: https://github.com/nodejs/node/pull/24116
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2018-11-05 22:26:44 -08:00
Daniel Bevenius
615160c38b test: add crypto check to test-benchmark-http2
Currently, this test will fail when configured --without-ssl. This
commit adds a crypto check to have this test skipped when configured
without crypto support.

PR-URL: https://github.com/nodejs/node/pull/24096
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-11-06 07:19:38 +01:00
Ouyang Yadong
33fbb93d2f http2: add Http2Stream.bufferSize
This commit adds `bufferSize` for `Http2Stream`.

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

PR-URL: https://github.com/nodejs/node/pull/23711
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-11-05 22:00:35 -08:00
MaleDong
9a20a12830 lib:fix grammar error and make it clearer for comments
1) Should be passive voice instead of `can overridden`.
2) Change the order of the two sentences to make it more clear about
'What can be overridden' instead of 'Can be overridden'.

PR-URL: https://github.com/nodejs/node/pull/23799
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-11-05 21:58:20 -08:00
Ouyang Yadong
3458e65127 net: net.Server.listen() avoid operations on null when fail
When `net.Server` fails to create a new handle, an error shall be
emitted in the next tick. Therefore, we make `net.Server.listen()`
directly  return to avoid following operations on `null`
`this._handle`.

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

PR-URL: https://github.com/nodejs/node/pull/23920
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2018-11-05 21:02:56 -08:00
Joyee Cheung
04a291abec console: bind methods from the prototype chain in Console
In 62232361 we made the console.Console function construct an object
with methods from Console.prototype bound to the instance, instead of
with methods found on the prototype chain to be bound on the instances,
thus breaking users overriding these methods when subclassing Console
because they are not expecting this function to construct a
namespace whose methods are not looked up from the prototype
chain.

This patch restores the previous behavior since it does not affect
the characteristics of the global console anyway. So after this patch,
the Console function still constructs normal objects with function
properties looked up from the prototype chain but bound to the
instances always.

PR-URL: https://github.com/nodejs/node/pull/24047
Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-11-05 20:53:59 -08:00
Joyee Cheung
c3b674cc11 lib: move module exports proxy into a separate method
Also added the comment in f074612b7 to make
NativeModule.prototype.compile() more readable.

PR-URL: https://github.com/nodejs/node/pull/24057
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2018-11-06 05:40:58 +01:00
Refael Ackermann
17e4213987 meta,doc: ping community about new release
PR-URL: https://github.com/nodejs/node/pull/24064
Refs: http://logs.libuv.org/node-build/2018-11-03#16:44:59.388
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-11-05 19:23:42 -08:00
Michaël Zasso
5c2d555b29
deps: patch V8 to 7.0.276.35
Refs: https://github.com/v8/v8/compare/7.0.276.32...7.0.276.35

PR-URL: https://github.com/nodejs/node/pull/24056
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2018-11-05 20:01:39 +01:00
Rich Trott
7e1b178fb6 doc: streamline CONTRIBUTING.md
PR-URL: https://github.com/nodejs/node/pull/24010
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2018-11-05 05:59:49 +01:00
Michaël Zasso
b623491371 doc: add table of contents to release guide
Also move Announce step to after technical stuff.

PR-URL: https://github.com/nodejs/node/pull/24042
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-11-05 05:48:05 +01:00
Refael Ackermann
765766be64 build: add common defines
* `V8_DEPRECATION_WARNINGS` is here for explicity. It is already defined
  in `node.gypi`, and `addon.gypi`.
* `V8_IMMINENT_DEPRECATION_WARNINGS` added to warn addons authors.
* `OPENSSL_THREADS` apears in the openSSL `.h` files, and was only
  defined via GYP for the node build.

PR-URL: https://github.com/nodejs/node/pull/23426
Fixes: https://github.com/nodejs/node/issues/23167
Refs: https://github.com/nodejs/node/issues/23122
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-11-04 21:51:49 -05:00
Richard Lau
809be432c0 build: fix Travis non-PR builds
Don't return non-zero if TRAVIS_PULL_REQUEST == "false".

PR-URL: https://github.com/nodejs/node/pull/24093
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2018-11-04 18:09:50 -08:00
Anna Henningsen
bde8eb5f82 build: do not lint on non-PR Travis builds
Do not run any linting at all when `TRAVIS_PULL_REQUEST` is `false`.
This would otherwise break Travis CI for `master` and release branches.

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

PR-URL: https://github.com/nodejs/node/pull/24076
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2018-11-04 06:42:38 -08:00
Anna Henningsen
c6d29ccf5a
buffer: do proper error propagation in addon methods
- Always fulfill the `MaybeLocal<>` contract by scheduling an
  exception when returning an empty value. This was previously
  inconsistent, with no way to know whether an exception was
  be scheduled or not in case of failure.
- Make sure that memory is released exactly once in case of
  failure. Previously, some exit conditions would have leaked
  memory or attempted to free it multiple times.

This should not really affect how `Buffer`s are created by
addons in practice, due to the low frequency with which
these errors would typically occur.

PR-URL: https://github.com/nodejs/node/pull/23939
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-11-04 12:00:35 +01:00
Rich Trott
1c67e741a1
doc: add missing comma in net documentation
PR-URL: https://github.com/nodejs/node/pull/24074
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2018-11-04 11:58:28 +01:00
mritunjaygoutam12
c8757f8c4f doc: correct link to test coverage command
PR-URL: https://github.com/nodejs/node/pull/24049
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-11-04 12:17:03 +02:00
Richard Lau
7489ee8b6f tools: add script to lint first PR commit message
Decouple first commit in pull request linting from Travis by using
the GitHub API to work out the first commit.

The shell script obtains the pull request number in one of the
following ways:
 1) supplied on the command line (use this to test against any PR)
 2) derived from the HEAD commit via the GitHub API

PR-URL: https://github.com/nodejs/node/pull/24030
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2018-11-04 00:22:30 -07:00
Anna Henningsen
bb254578a6 doc: fix socket.connecting description
In particular, this value is `true` and not `false`
between calling `connect()` and the operation finishing.

PR-URL: https://github.com/nodejs/node/pull/24066
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2018-11-04 00:20:34 -07:00
warnerp18
472a3d890b doc: add SECURITY.md to readme.md
This adds a SECURITY.md file and links to the security document per the
request of @https://github.com/Trott at a recent SF Node meetup.

PR-URL: https://github.com/nodejs/node/pull/24031
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-11-04 00:08:18 -07:00
Rich Trott
f581aced91 doc: edit man page for superfluous "node" usage
Rather than ponder "node" vs. "Node.js", remove the descriptor so it's
just "command-line options" rather than "node command-line options" or
"Node.js command-line options".

PR-URL: https://github.com/nodejs/node/pull/24029
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-11-03 23:54:03 -07:00
Anna Henningsen
9c7d19104d buffer: throw exception when creating from non-Node.js Context
Throw an exception instead of crashing when attempting to create
`Buffer` objects from a Context that is not associated with
a Node.js `Environment`.

Possible alternatives for the future might be just returning
a plain `Uint8Array`, or working on providing `Buffer` for all
`Context`s.

PR-URL: https://github.com/nodejs/node/pull/23938
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2018-11-03 23:31:03 -07:00
Rod Vagg
d8fb81fab3 deps: float 99540ec from openssl (CVE-2018-0735)
Low severity timing vulnerability in ECDSA signature generation

Publicly disclosed but unreleased, pending OpenSSL 1.1.0j

Also includes trivial syntax fix from
https://github.com/openssl/openssl/pull/7516

Ref: https://www.openssl.org/news/secadv/20181029.txt
Ref: https://github.com/openssl/openssl/pull/7486
PR-URL: https://github.com/nodejs/node/pull/???
Upstream: https://github.com/openssl/openssl/commit/99540ec

Original commit message:

    Timing vulnerability in ECDSA signature generation (CVE-2018-0735)

    Preallocate an extra limb for some of the big numbers to avoid a reallocation
    that can potentially provide a side channel.

    Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
    (Merged from https://github.com/openssl/openssl/pull/7486)

PR-URL: https://github.com/nodejs/node/pull/23950
Refs: https://www.openssl.org/news/secadv/20181029.txt
Refs: https://github.com/openssl/openssl/pull/7486
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-11-03 19:45:05 -07:00
Rod Vagg
213c7d2d64 deps: float a9cfb8c2 from openssl (CVE-2018-0734)
Low severity timing vulnerability in the DSA signature algorithm

Publicly disclosed but unreleased, pending OpenSSL 1.1.0j

Ref: https://github.com/openssl/openssl/pull/7486
Ref: https://www.openssl.org/news/secadv/20181030.txt
PR-URL: https://github.com/nodejs/node/pull/???
Upstream: https://github.com/openssl/openssl/commit/a9cfb8c2

Original commit message:

    Avoid a timing attack that leaks information via a side channel that
    triggers when a BN is resized.  Increasing the size of the BNs
    prior to doing anything with them suppresses the attack.

    Thanks due to Samuel Weiser for finding and locating this.

    Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
    (Merged from https://github.com/openssl/openssl/pull/7486)

PR-URL: https://github.com/nodejs/node/pull/23965
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-11-03 19:42:39 -07:00
Rod Vagg
e2260e901d deps: float 415c3356 from openssl (DSA vulnerability)
Low severity timing vulnerability in the DSA signature algorithm

Publicly disclosed but unreleased, pending OpenSSL 1.1.0j, not deemed
severe enough to be assigned a CVE #.

Ref: https://github.com/openssl/openssl/pull/7487
PR-URL: https://github.com/nodejs/node/pull/???
Upstream: https://github.com/openssl/openssl/commit/415c3356

Original commit message:

    DSA mod inverse fix

    There is a side channel attack against the division used to calculate one of
    the modulo inverses in the DSA algorithm.  This change takes advantage of the
    primality of the modulo and Fermat's little theorem to calculate the inverse
    without leaking information.

    Thanks to Samuel Weiser for finding and reporting this.

    Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
    Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
    (Merged from https://github.com/openssl/openssl/pull/7487)

PR-URL: https://github.com/nodejs/node/pull/23965
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-11-03 19:42:37 -07:00
Weijia Wang
c1e670338b repl: use promise#finally
PR-URL: https://github.com/nodejs/node/pull/23971
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-11-03 19:40:18 -07:00
James M Snell
7825045ee6 http2: improve http2 code a bit
Multiple general improvements to http2 internals for
readability and efficiency

PR-URL: https://github.com/nodejs/node/pull/23984
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-11-03 19:38:24 -07:00
João Reis
ab2778d763 win: add prompt to tools installation script
Fixes: https://github.com/nodejs/Release/issues/369

PR-URL: https://github.com/nodejs/node/pull/23987
Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-11-03 19:35:39 -07:00
Rob Reynolds
5833fa989d win: clarify Boxstarter behavior on install tools
Clarify the behavior of what Boxstarter may do when it runs on a box
to install all the necessary tools so that there are no surprises to
the end user when the script is run.

Currently there is no interface that warns the user that Boxstarter
will reboot the machine possibly multiple times depending on how many
dependencies need to be installed and doesn't mention a need to disable
UAC. For folks who see what may look like a reboot loop, we feel it is
necessary to make them aware that UAC will be disabled and they will
need to take action to re-enable UAC manually if they interfere/stop
the script from finishing.

PR-URL: https://github.com/nodejs/node/pull/23987
Fixes: https://github.com/nodejs/Release/issues/369
Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-11-03 19:34:57 -07:00
Daniel Bevenius
315b1c656c n-api: add missing handle scopes
Currently when building with --debug
test/addons-napi/test_threadsafe_function will error:

$  out/Debug/node test/addons-napi/test_threadsafe_function/test.js
FATAL ERROR: v8::HandleScope::CreateHandle()
  Cannot create a handle without a HandleScope
 1: 0x10004e287 node::DumpBacktrace(__sFILE*) [node/out/Debug/node]
 2: 0x1000cd37b node::Abort() [/node/out/Debug/node]
 3: 0x1000cd69f node::OnFatalError(char const*, char const*)
    [/node/out/Debug/node]
 4: 0x1004df0b1 v8::Utils::ReportApiFailure(char const*, char const*)
    [/nodejs/node/out/Debug/node]
 5: 0x100a8c0a9 v8::internal::HandleScope::Extend(
        v8::internal::Isolate*)
    [/node/out/Debug/node]
 6: 0x1004e4229 v8::EmbedderDataFor(v8::Context*,
                                    int, bool,
                                    char const*)
    [/node/out/Debug/node]
 7: 0x1004e43fa v8::Context::SlowGetAlignedPointerFromEmbedderData(int)
    [/node/out/Debug/node]
 8: 0x10001c26b v8::Context::GetAlignedPointerFromEmbedderData(int)
    [/node/out/Debug/node]
 9: 0x1000144ea node::Environment::GetCurrent(v8::Local<v8::Context>)
    [/node/out/Debug/node]
10: 0x1000f49e2 napi_env__::node_env() const
    [/node/out/Debug/node]
11: 0x1000f9885
    (anonymous namespace)::v8impl::ThreadSafeFunction::
        CloseHandlesAndMaybeDelete(bool)
    [/node/out/Debug/node]
12: 0x1000fb34f (anonymous namespace)::v8impl::ThreadSafeFunction::
        DispatchOne()
    [/node/out/Debug/node]
13: 0x1000fb129
    (anonymous namespace)::v8impl::ThreadSafeFunction::
        IdleCb(uv_idle_s*)
    [/node/out/Debug/node]
14: 0x1011a1b69 uv__run_idle
    [/node/out/Debug/node]
15: 0x101198179 uv_run
    [/node/out/Debug/node]
16: 0x1000dfca1
    node::Start(...)
    [/node/out/Debug/node]
17: 0x1000dae50 node::Start(...)
    [/node/out/Debug/node]
18: 0x1000da56f node::Start(int, char**)
    [/node/out/Debug/node]
19: 0x10141112e main
    [/node/out/Debug/node]
20: 0x100001034 start
    [/node/out/Debug/node]
Abort trap: 6

This commit adds two HandleScope's, one to CloseHandlesAndMaybeDelete
and one to the lambda.

SlowGetAlignedPointerFromEmbedderData will only be called for debug
builds:
2ef0aa662f
/include/v8.h#L10440-L10447

PR-URL: https://github.com/nodejs/node/pull/24011
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2018-11-03 19:27:18 -07:00
ZYSzys
22f5c0892b lib: remove useless getLibuvNow in internal/timers
PR-URL: https://github.com/nodejs/node/pull/23995
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matheus Marchini <mat@mmarchini.me>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
2018-11-03 19:15:57 -07:00
Joyee Cheung
bcc7b7a58c fs: handle result of access binding directly in fs.existsSync
Instead of throwing errors in fs.accessSync and then catching it,
handle the result from the binding directly in fs.existsSync.

Note that the argument validation errors still needs to be caught
until we properly deprecate the don't-thrown-on-invalid-arguments
behavior.

PR-URL: https://github.com/nodejs/node/pull/24015
Fixes: https://github.com/nodejs/node/issues/24008
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2018-11-03 18:43:00 -07:00
Benjamin
616fac9169 lib: make coverage work for Node.js
PR-URL: https://github.com/nodejs/node/pull/23941
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yang Guo <yangguo@chromium.org>
2018-11-03 18:35:04 -07:00
Daniel Bevenius
2ea70eae73 src: fix compiler warning for debug build
This commit updates the check of the offset argument passed to
CallJSOnreadMethod to avoid doing a cast as this currently generates
the following compiler warning when doing a debug build:

./src/stream_base.cc:295:3:
warning: comparison of integers of different signs:
'int32_t' (aka 'int') and 'size_t' (aka 'unsigned long')
[-Wsign-compare]
  CHECK_EQ(static_cast<int32_t>(offset), offset);
  ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~

PR-URL: https://github.com/nodejs/node/pull/23994
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matheus Marchini <mat@mmarchini.me>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-11-03 00:13:09 -07:00
Daniel Bevenius
eada8c7ca2 test: increase --stack_size test-async-wrap-pop
Currently, when building with --debug
test-async-wrap-pop-id-during-load fails on macosx with the following
error:

$ out/Debug/node test/parallel/test-async-wrap-pop-id-during-load.js
assert.js:86
  throw new AssertionError(obj);
  ^

AssertionError [ERR_ASSERTION]: EXIT CODE: 1, STDERR:
internal/bootstrap/loaders.js:275
      const script = new ContextifyScript(
                     ^

RangeError: Maximum call stack size exceeded
    at NativeModule.compile (internal/bootstrap/loaders.js:275:22)
    at NativeModule.require (internal/bootstrap/loaders.js:168:18)
    at assert.js:31:43
    at NativeModule.compile (internal/bootstrap/loaders.js:299:7)
    at NativeModule.require (internal/bootstrap/loaders.js:168:18)
    at internal/process/main_thread_only.js:23:16
    at NativeModule.compile (internal/bootstrap/loaders.js:299:7)
    at Function.NativeModule.require
      (internal/bootstrap/loaders.js:168:18)
    at startup (internal/bootstrap/node.js:58:38)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:878:3)

    at Object.<anonymous>
       (/node/test/parallel/test-async-wrap-pop-id-during-load.js:21:8)
    at Module._compile (internal/modules/cjs/loader.js:707:30)
    at Object.Module._extensions..js
      (internal/modules/cjs/loader.js:718:10)
    at Module.load (internal/modules/cjs/loader.js:605:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:544:12)
    at Function.Module._load (internal/modules/cjs/loader.js:536:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:760:12)
    at startup (internal/bootstrap/node.js:308:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:878:3)

This commit suggests increasing the stack_size to 80.

Refs: https://github.com/nodejs/node/pull/20940
PR-URL: https://github.com/nodejs/node/pull/23996
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2018-11-03 00:11:18 -07:00
Refael Ackermann
d24756bf79 deps,v8: cherry-pick dc704497
Original commit message:
  undef min,max macros on windows

  This blocks building with official clang-cl and Windows SDK

  Refs: https://github.com/nodejs/node/issues/19630
  Change-Id: I41fdf934f486c660df7a9e0dd284f6eb3c294dd4
  Reviewed-on: https://chromium-review.googlesource.com/c/1297479
  Commit-Queue: Jakob Gruber <jgruber@chromium.org>
  Reviewed-by: Jakob Gruber <jgruber@chromium.org>
  Cr-Commit-Position: refs/heads/master@{#57053}

PR-URL: https://github.com/nodejs/node/pull/23985
Refs: dc704497ee
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-11-02 20:30:28 -04:00
Ivan Filenko
c51d47d5df doc: fix dublication in net.createServer() docs
PR-URL: https://github.com/nodejs/node/pull/24026
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-11-02 23:38:04 +02:00