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

26111 Commits

Author SHA1 Message Date
Rich Trott
83c06d8f7b tools: update dmn to 2.2.1 in update scripts
dmn 2.2.1 cleans more files than earlier versions.

PR-URL: https://github.com/nodejs/node/pull/26462
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
2019-03-07 20:48:50 -08:00
Ruben Bridgewater
82f8821401 repl: add replDefaults to customize the writer
So far it was not possible to modify the inspection defaults used by
the REPL from the running instance itself. This introduces a new
property on `util.inspect` which is only used inside the REPL and which
allows to modify the used inspection defaults at any point of time.

PR-URL: https://github.com/nodejs/node/pull/26375
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-03-08 04:44:56 +01:00
gengjiawen
6de88015bb src: remove redundant cast in util-inl.h
PR-URL: https://github.com/nodejs/node/pull/26410
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2019-03-08 04:24:12 +01:00
Yang Guo
ede1a7ceb4 tools: fix test.py --shell
This fixes the necessary plumbing to make the --shell argument
have its intended effect.

PR-URL: https://github.com/nodejs/node/pull/26449
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2019-03-08 04:03:52 +01:00
Refael Ackermann
91e1a043a6 Revert "build: silence cpp lint by default"
This reverts commit 0373836b39.

PR-URL: https://github.com/nodejs/node/pull/26358
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-03-07 18:46:27 -05:00
cjihrig
c1a9c50008
test: refactor test/report/test-report-signal.js
PR-URL: https://github.com/nodejs/node/pull/26446
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Masashi Hirano <shisama07@gmail.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-03-07 15:48:06 -05:00
Tobias Nießen
3e4e51870c
crypto: simplify GetPublicOrPrivateKeyFromJs
PR-URL: https://github.com/nodejs/node/pull/26454
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Masashi Hirano <shisama07@gmail.com>
2019-03-07 21:34:08 +01:00
Anna Henningsen
aec34473a7
test: remove usage of process.binding()
Prefer `internalBinding` or other equivalents over `process.binding()`
(except in tests checking `process.binding()` itself).

PR-URL: https://github.com/nodejs/node/pull/26304
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-03-07 17:43:21 +01:00
kohta ito
1133e0bf8b
child_process: fire close event from stdio
PR-URL: https://github.com/nodejs/node/pull/22892
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-03-07 17:38:39 +01:00
Richard Lau
82a256ac67 test: fix tests so they work in worker threads
Use the `cwd` option for child_process instead of `process.chdir()` to
allow tests to work with worker threads.

PR-URL: https://github.com/nodejs/node/pull/26453
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-03-07 11:09:30 -05:00
Anna Henningsen
76e67e9884
lib: assign missed deprecation code
Refs: https://github.com/nodejs/node/pull/26245

PR-URL: https://github.com/nodejs/node/pull/26492
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-03-07 15:48:55 +01:00
gengjiawen
0fa11654c7 http: remove unused variable in _http_server.js
PR-URL: https://github.com/nodejs/node/pull/26407
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-03-07 06:18:43 +01:00
gengjiawen
d08a574d7e src: make parameter name const reference in method TriggerNodeReport
PR-URL: https://github.com/nodejs/node/pull/26397
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-03-07 04:40:38 +01:00
gengjiawen
f25c5ad344 src: remove redundant call in inspector_io.cc
PR-URL: https://github.com/nodejs/node/pull/26427
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2019-03-07 04:28:00 +01:00
Rich Trott
9f2bde5da5 tools: update remark-preset-lint-node to 1.5.0
This update includes an additional check for `End-of-life`. For
consistency, we use `End-of-Life` everywhere.

PR-URL: https://github.com/nodejs/node/pull/26442
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
2019-03-06 15:50:46 -08:00
Rich Trott
7ffbb4606f doc: standardize on End-of-Life capitalization
Use "End-of-Life" everywhere and not "End-of-life" or "End-Of-Life".

PR-URL: https://github.com/nodejs/node/pull/26442
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
2019-03-06 15:50:43 -08:00
Nicolas Moteau
d50fc510a8
doc: add missing https Agent maxCachedSessions
PR-URL: https://github.com/nodejs/node/pull/26433
Refs: https://github.com/nodejs/node/pull/2228
Refs: https://github.com/nodejs/node/pull/4252
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-03-07 00:41:21 +01:00
Anna Henningsen
31147c4704
buffer: do not affect memory after target for utf16 write
Do not write one character too much before shifting the whole result
to the left when using UTF16-LE, possibly overwriting already-used
memory while doing so.

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

PR-URL: https://github.com/nodejs/node/pull/26432
Fixes: https://github.com/nodejs/node/issues/26422
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
2019-03-07 00:40:21 +01:00
Richard Lau
ceb73e714a
build: indicate that configure has done something
If run without `--verbose` configure exits silently with no indication
that it has done anything. Print a message on completion to indicate
that the script has worked.

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

PR-URL: https://github.com/nodejs/node/pull/26436
Refs: https://github.com/nodejs/node/issues/23111
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-03-07 00:39:39 +01:00
Refael Ackermann
dfffb6d2af
build,win: simplify new msbuild_arg option
PR-URL: https://github.com/nodejs/node/pull/26431
Refs: https://github.com/nodejs/node/pull/25994
Reviewed-By: João Reis <reis@janeasystems.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-03-07 00:39:06 +01:00
shisama
70beb76f92
tools: add no-var lint rule for tools directory
PR-URL: https://github.com/nodejs/node/pull/26398
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-03-07 00:35:02 +01:00
Masashi Hirano
ce8f01cf0c
tools: replace var to let/const
PR-URL: https://github.com/nodejs/node/pull/26398
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-03-07 00:35:01 +01:00
gengjiawen
95e3119bad
src: remove redundant cast in string_search.h
PR-URL: https://github.com/nodejs/node/pull/26426
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-03-07 00:31:39 +01:00
gengjiawen
51563b24a6
src: remove unused function in cares_wrap.cc
PR-URL: https://github.com/nodejs/node/pull/26429
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-03-07 00:29:48 +01:00
gengjiawen
9164543bdc
src: fix wrong enum reference in node.cc
PR-URL: https://github.com/nodejs/node/pull/26430
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2019-03-07 00:29:19 +01:00
Joyee Cheung
03c71a95e2
src: use the config binding to carry --no-browser-globals
Instead of setting it in the process object, since this is
a configure-time option. Also added a shim that can be
deprecated and removed some time later.

PR-URL: https://github.com/nodejs/node/pull/26228
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-03-07 00:27:40 +01:00
Patrick Gansterer
4895927a0a
crypto: add KeyObject.asymmetricKeySize
Expose the size of asymetric keys of crypto key object from the
crypto module added in v11.6.0.

PR-URL: https://github.com/nodejs/node/pull/26387
Refs: https://github.com/nodejs/node/pull/24234
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-03-07 00:24:07 +01:00
Beni von Cheni
53d4e04be5
lib: migrate process.binding to internalBinding
Migrate various modules from using process.binding to internalBinding.

PR-URL: https://github.com/nodejs/node/pull/24952
Refs: https://github.com/nodejs/node/issues/22160
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-03-07 00:21:08 +01:00
Richard Lau
80209cc4c9 test: relax timer check in test-report-uv-handles.js
The underlying JavaScript runtime may schedule tasks at its discretion
so there may be more timer handles than the one created by the test.

PR-URL: https://github.com/nodejs/node/pull/26434
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2019-03-06 16:26:44 -05:00
Rich Trott
05606c6690 doc: edit deprecation section of Collaborator Guide
Edit the last few paragraphs of the Collaborator Guide section on
deprecations.

PR-URL: https://github.com/nodejs/node/pull/26419
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-03-06 13:12:24 -08:00
Ruben Bridgewater
b22ee71ef6
2019-03-06, Version 11.11.0 (Current)
Notable Changes

* n-api:
  * Implement date object (Jarrod Connolly)
    https://github.com/nodejs/node/pull/25917
* util:
  * Add compact depth mode for `util.inspect()` (Ruben Bridgewater)
    https://github.com/nodejs/node/pull/26269
* worker:
  * Improve integration with native addons (Anna Henningsen)
    https://github.com/nodejs/node/pull/26175
  * MessagePort.prototype.onmessage takes arguments closer to the Web
    specification now (Anna Henningsen)
    https://github.com/nodejs/node/pull/26082
2019-03-06 20:24:50 +01:00
Joyee Cheung
f3d6207874
doc: fix the example implementation of MemoryRetainer
We need to be careful not to include the size of non-pointer
fields in the parent's self size if we want to track them separately
as a different node.

Refs: https://github.com/nodejs/node/pull/26161/files#r259170771

PR-URL: https://github.com/nodejs/node/pull/26262
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-03-06 17:48:55 +01:00
Nitish Sakhawalkar
617f0554be src: fix build when NODE_USE_V8_PLATFORM is not defined
PR-URL: https://github.com/nodejs/node/pull/26380
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2019-03-06 10:49:04 -05:00
Matteo Collina
3c83f93437 http: check for existance in resetHeadersTimeoutOnReqEnd
socket.parser can be undefined under unknown circumstances.
This is a fix for a bug I cannot reproduce but it is affecting
people.

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

PR-URL: https://github.com/nodejs/node/pull/26402
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-03-06 14:32:39 +00:00
gengjiawen
3770ab99a8 src: remove unused variable in node_http2.cc
PR-URL: https://github.com/nodejs/node/pull/26395
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-03-06 10:04:58 +01:00
Matteo Collina
e95e7f9af5 stream: make sure 'readable' is emitted before ending the stream
Fixes: https://github.com/nodejs/node/issues/25810

PR-URL: https://github.com/nodejs/node/pull/26059
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-03-06 08:38:29 +00:00
Refael Ackermann
d38cd82513 build,deps: less warnings from V8
PR-URL: https://github.com/nodejs/node/pull/26405
Reviewed-By: Yang Guo <yangguo@chromium.org>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2019-03-05 22:21:14 -05:00
Luigi Pinca
8a291a8e83
doc: clarify http.Agent constructor options
PR-URL: https://github.com/nodejs/node/pull/26412
Fixes: https://github.com/nodejs/node/issues/26357
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Masashi Hirano <shisama07@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-03-06 00:11:27 +01:00
gengjiawen
e96ac8434a
src: remove unused variable in node_native_module.cc
PR-URL: https://github.com/nodejs/node/pull/26411
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: Ruben Bridgewater <ruben@bridgewater.de>
2019-03-06 00:08:16 +01:00
Anna Henningsen
6e3b216474
doc: update AUTHORS list
PR-URL: https://github.com/nodejs/node/pull/26383
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2019-03-06 00:04:56 +01:00
Anna Henningsen
713046d9eb
tools: add mailmap support for Co-authored-by tags
Support `.mailmap` for manually added `Author:` and
`Co-authored-by:` tags.

PR-URL: https://github.com/nodejs/node/pull/26383
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2019-03-06 00:04:55 +01:00
Jeremy Apthorp
a132b8ae5c
src: fix more extra-semi warnings
PR-URL: https://github.com/nodejs/node/pull/26340
Reviewed-By: Masashi Hirano <shisama07@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-03-05 23:57:25 +01:00
Geir Hauge
9a2025ca8a
doc: hello addon example should return "world"
The N-API version of the hello example, returned "hello" instead of
"world".

PR-URL: https://github.com/nodejs/node/pull/26328
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2019-03-05 23:54:31 +01:00
Luigi Pinca
49f1bb9b93
stream: ensure writable.destroy() emits error once
Prevent the `'error'` event from being emitted multiple times if
`writable.destroy()` is called with an error before the `_destroy()`
callback is called.

Emit the first error, discard all others.

PR-URL: https://github.com/nodejs/node/pull/26057
Fixes: https://github.com/nodejs/node/issues/26015
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-03-05 23:52:36 +01:00
Vse Mozhet Byt
60aaf2c214 doc: fix nits in report docs
* Fix heading levels.
* Fix section sorting.
* Add quotes around string values.
* Remove quotes around property names.

PR-URL: https://github.com/nodejs/node/pull/26461
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-03-06 00:51:01 +02:00
Anna Henningsen
69906fbc52
benchmark,lib: add process.hrtime.bigint benchmark
Add a benchmark, and amend the relevant source code comment to state
that currently, switching to directly returning a BigInt is not
stopped by technical obstacles but rather the fact that using a typed
array is actually a bit faster (about 2.5 %, measured locally).

PR-URL: https://github.com/nodejs/node/pull/26381
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-03-05 23:23:53 +01:00
Anna Henningsen
820ae61c12
src: forbid handle allocations from Platform tasks
Platform tasks should have their own handle scopes, rather than
leak into outer ones.

PR-URL: https://github.com/nodejs/node/pull/26376
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-03-05 22:40:04 +01:00
Anna Henningsen
753ebd742f
src: allow running tasks without Environment
There is no real reason to assume that V8 tasks would have
to run in a Node.js `Context`.

PR-URL: https://github.com/nodejs/node/pull/26376
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-03-05 22:40:02 +01:00
Anna Henningsen
cf699a02ca
src: prefer to get Environment from Context
We explicitly store the context anyway, and can skip the
extra steps introduced in `Environment::GetCurrent()`.

PR-URL: https://github.com/nodejs/node/pull/26376
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-03-05 22:40:01 +01:00
Anna Henningsen
c2f620ab76
src: refactor Environment::GetCurrent(isolate) usage
Do not require an explicit `HandleScope`, or the ability to create
one, when using `Environment::GetCurrent()`.

`isolate->InContext()` is used as an indicator that it is probably
okay to create a `HandleScope`, see also the short discussion in
https://github.com/nodejs/node/pull/25775#pullrequestreview-197371049.

PR-URL: https://github.com/nodejs/node/pull/26376
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-03-05 22:40:00 +01:00