summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Working on v14.18.1Michaël Zasso2021-09-281-2/+2
| | | | PR-URL: https://github.com/nodejs/node/pull/39990
* 2021-09-28, Version 14.18.0 'Fermium' (LTS)v14.18.0v14.18.0-proposalMichaël Zasso2021-09-071-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Notable changes: assert: * change status of legacy asserts (James M Snell) https://github.com/nodejs/node/pull/38113 buffer: * (SEMVER-MINOR) introduce Blob (James M Snell) https://github.com/nodejs/node/pull/36811 * (SEMVER-MINOR) add base64url encoding option (Filip Skokan) https://github.com/nodejs/node/pull/36952 child_process: * (SEMVER-MINOR) allow `options.cwd` receive a URL (Khaidi Chu) https://github.com/nodejs/node/pull/38862 * (SEMVER-MINOR) add timeout to spawn and fork (Nitzan Uziely) https://github.com/nodejs/node/pull/37256 * (SEMVER-MINOR) allow promisified exec to be cancel (Carlos Fuentes) https://github.com/nodejs/node/pull/34249 * (SEMVER-MINOR) add 'overlapped' stdio flag (Thiago Padilha) https://github.com/nodejs/node/pull/29412 cli: * (SEMVER-MINOR) add -C alias for --conditions flag (Guy Bedford) https://github.com/nodejs/node/pull/38755 * (SEMVER-MINOR) add --node-memory-debug option (Anna Henningsen) https://github.com/nodejs/node/pull/35537 dns: * (SEMVER-MINOR) add "tries" option to Resolve options (Luan Devecchi) https://github.com/nodejs/node/pull/39610 * (SEMVER-MINOR) allow `--dns-result-order` to change default dns verbatim (Ouyang Yadong) https://github.com/nodejs/node/pull/38099 doc: * (SEMVER-MINOR) add missing change to resolver ctor (Luan Devecchi) https://github.com/nodejs/node/pull/39610 * refactor fs docs structure (James M Snell) https://github.com/nodejs/node/pull/37170 errors: * (SEMVER-MINOR) remove experimental from --enable-source-maps (Benjamin Coe) https://github.com/nodejs/node/pull/37362 esm: * deprecate legacy main lookup for modules (Guy Bedford) https://github.com/nodejs/node/pull/36918 fs: * (SEMVER-MINOR) allow empty string for temp directory prefix (Voltrex) https://github.com/nodejs/node/pull/39028 * (SEMVER-MINOR) allow no-params fsPromises fileHandle read (Nitzan Uziely) https://github.com/nodejs/node/pull/38287 * (SEMVER-MINOR) add support for async iterators to `fsPromises.writeFile` (HiroyukiYagihashi) https://github.com/nodejs/node/pull/37490 * improve fsPromises readFile performance (Nitzan Uziely) https://github.com/nodejs/node/pull/37608 * (SEMVER-MINOR) add fsPromises.watch() (James M Snell) https://github.com/nodejs/node/pull/37179 * (SEMVER-MINOR) allow `position` parameter to be a `BigInt` in read and readSync (Darshan Sen) https://github.com/nodejs/node/pull/36190 http2: * (SEMVER-MINOR) add support for sensitive headers (Anna Henningsen) https://github.com/nodejs/node/pull/34145 * (SEMVER-MINOR) allow setting the local window size of a session (Yongsheng Zhang) https://github.com/nodejs/node/pull/35978 inspector: * mark as stable (Gireesh Punathil) https://github.com/nodejs/node/pull/37748 module: * (SEMVER-MINOR) add support for `URL` to `import.meta.resolve` (Antoine du Hamel) https://github.com/nodejs/node/pull/38587 * (SEMVER-MINOR) add support for `node:`‑prefixed `require(…)` calls (ExE Boss) https://github.com/nodejs/node/pull/37246 net: * (SEMVER-MINOR) introduce net.BlockList (James M Snell) https://github.com/nodejs/node/pull/34625 node-api: * (SEMVER-MINOR) allow retrieval of add-on file name (Gabriel Schulhof) https://github.com/nodejs/node/pull/37195 os: * (SEMVER-MINOR) add os.devNull (Luigi Pinca) https://github.com/nodejs/node/pull/38569 perf_hooks: * (SEMVER-MINOR) introduce createHistogram (James M Snell) https://github.com/nodejs/node/pull/37155 process: * (SEMVER-MINOR) add api to enable source-maps programmatically (legendecas) https://github.com/nodejs/node/pull/39085 * (SEMVER-MINOR) add `'worker'` event (James M Snell) https://github.com/nodejs/node/pull/38659 * (SEMVER-MINOR) add direct access to rss without iterating pages (Adrien Maret) https://github.com/nodejs/node/pull/34291 readline: * (SEMVER-MINOR) add AbortSignal support to interface (Nitzan Uziely) https://github.com/nodejs/node/pull/37932 * (SEMVER-MINOR) add support for the AbortController to the question method (Mattias Runge-Broberg) https://github.com/nodejs/node/pull/33676 * (SEMVER-MINOR) add history event and option to set initial history (Mattias Runge-Broberg) https://github.com/nodejs/node/pull/33662 repl: * (SEMVER-MINOR) add auto‑completion for `node:`‑prefixed `require(…)` calls (ExE Boss) https://github.com/nodejs/node/pull/37246 src: * (SEMVER-MINOR) call overload ctor from the original ctor (Darshan Sen) https://github.com/nodejs/node/pull/39768 * (SEMVER-MINOR) add a constructor overload for CallbackScope (Darshan Sen) https://github.com/nodejs/node/pull/39768 * (SEMVER-MINOR) allow to negate boolean CLI flags (Michaël Zasso) https://github.com/nodejs/node/pull/39023 * (SEMVER-MINOR) add --heapsnapshot-near-heap-limit option (Joyee Cheung) https://github.com/nodejs/node/pull/33010 * (SEMVER-MINOR) add way to get IsolateData and allocator from Environment (Anna Henningsen) https://github.com/nodejs/node/pull/36441 * (SEMVER-MINOR) allow preventing SetPrepareStackTraceCallback (Shelley Vohr) https://github.com/nodejs/node/pull/36447 * (SEMVER-MINOR) add maybe versions of EmitExit and EmitBeforeExit (Anna Henningsen) https://github.com/nodejs/node/pull/35486 stream: * (SEMVER-MINOR) add readableDidRead if has been read from (Robert Nagy) https://github.com/nodejs/node/pull/39589 * (SEMVER-MINOR) pipeline accept Buffer as a valid first argument (Nitzan Uziely) https://github.com/nodejs/node/pull/37739 tls: * (SEMVER-MINOR) allow reading data into a static buffer (Andrey Pechkurov) https://github.com/nodejs/node/pull/35753 tools: * (SEMVER-MINOR) add `Worker` to type-parser (James M Snell) https://github.com/nodejs/node/pull/38659 url: * (SEMVER-MINOR) expose urlToHttpOptions utility (Yongsheng Zhang) https://github.com/nodejs/node/pull/35960 util: * (SEMVER-MINOR) expose toUSVString (Robert Nagy) https://github.com/nodejs/node/pull/39814 v8: * (SEMVER-MINOR) implement v8.stopCoverage() (Joyee Cheung) https://github.com/nodejs/node/pull/33807 * (SEMVER-MINOR) implement v8.takeCoverage() (Joyee Cheung) https://github.com/nodejs/node/pull/33807 worker: * (SEMVER-MINOR) add setEnvironmentData/getEnvironmentData (James M Snell) https://github.com/nodejs/node/pull/37486 PR-URL: https://github.com/nodejs/node/pull/39990
* build: add option to hide console windowCheng Zhao2021-09-045-1/+16
| | | | | | | | | | | | Adds a Environment flag to allow embedders to set CREATE_NO_WINDOW property when spawning processes, which is useful for GUI programs that do not want to show console windows when running terminal commands. PR-URL: https://github.com/nodejs/node/pull/39712 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Shelley Vohr <shelley.vohr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* src: fix TextDecoder final flush size calculationJames M Snell2021-09-041-2/+15
| | | | | | | | | | | Flushing a TextDecoder with a zero-sized input and pending incomplete characters was failing when fatal: false. Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/39737 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* node-api: handle pending exception in cb wrapperMichael Dawson2021-09-041-2/+6
| | | | | | | | | | | | | | | | | fixes: https://github.com/nodejs/node-addon-api/issues/1025 The functionreference test from the node-api tests was reporting a failed v8 check when Node.js was compiled as debug. The failure was because an exception was pending but the C++ wrappers were returning a return value that was invalid. Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: https://github.com/nodejs/node/pull/39476 Fixes: https://github.com/nodejs/node-addon-api/issues/1025 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
* src: add cosmetic space character to `async_wrap.h` fileJuan José Arboleda2021-09-041-1/+1
| | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/39459 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* src: print native module id on native module not foundlegendecas2021-09-041-1/+4
| | | | | | | | | | | | To help core contributors identify which file is missing from the build. PR-URL: https://github.com/nodejs/node/pull/39460 Refs: https://github.com/nodejs/node/issues/39408 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* src: close HandleWraps instead of deleting them in OnGCCollect()Anna Henningsen2021-09-042-2/+11
| | | | | | | | | | | | | | | | | | When all strong `BaseObjectPtr`s to a `HandleWrap` are gone, we should not delete the `HandleWrap` outright, but instead close it and then delete it only once the libuv close callback has been called. Based on the valgrind output from the issue below, this has a good chance of fixing it. Fixes: https://github.com/nodejs/node/issues/39036 PR-URL: https://github.com/nodejs/node/pull/39441 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* debugger: validate sec-websocket-accept response headerChris Opperwall2021-09-041-0/+1
| | | | | | | | | | | | | | This addresses a TODO to validate that the sec-websocket-accept header in the WebSocket handshake response is valid. To do this we need to append the WebSocket GUID to the original key sent in sec-websocket-key, sha1 hash it, and then compare the base64 encoding with the value sent in the sec-websocket-accept response header. If they don't match, an error is thrown. PR-URL: https://github.com/nodejs/node/pull/39357 Refs: https://github.com/nodejs/node-inspect/pull/93 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* deps: extract gtest source files to deps/googletestlegendecas2021-09-042-89/+0
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/39386 Refs: https://github.com/nodejs/node/pull/39361 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* process: add api to enable source-maps programmaticallylegendecas2021-09-041-3/+4
| | | | | | | | | Add `process.setSourceMapsEnabled` to enable source-maps programmatically. PR-URL: https://github.com/nodejs/node/pull/39085 Reviewed-By: Ben Coe <bencoe@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* src: remove unused guards around node-api referencelegendecas2021-09-042-4/+0
| | | | | PR-URL: https://github.com/nodejs/node/pull/38334 Reviewed-By: Michael Dawson <midawson@redhat.com>
* debugger: indicate server is endingRich Trott2021-09-041-1/+5
| | | | | | | | | | | Currently, we say "listening" when we are ending the server. Change it to "ending". Fixes: https://github.com/nodejs/node/issues/39272 PR-URL: https://github.com/nodejs/node/pull/39334 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Yash Ladha <yash@yashladha.in>
* node-api: cctest on v8impl::Referencelegendecas2021-09-047-331/+489
| | | | | | PR-URL: https://github.com/nodejs/node/pull/38970 Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Gabriel Schulhof <gabrielschulhof@gmail.com>
* inspector: move inspector async hooks to environmentJoyee Cheung2021-09-043-14/+15
| | | | | | | | | | | Since async hooks are per-environment and putting them in the environment allows us to serialize them for the snapshot automatically. PR-URL: https://github.com/nodejs/node/pull/39112 Refs: https://github.com/nodejs/node/pull/38905 Refs: https://github.com/nodejs/node/issues/35711 Reviewed-By: Anna Henningsen <anna@addaleax.net>
* doc: use ASCII order for md refsAntoine du Hamel2021-09-041-1/+1
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/39170 Refs: https://github.com/nodejs/remark-preset-lint-node/pull/188 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
* src,zlib: tighten up Z_*_WINDOWBITS macrosXadillaX2021-09-042-5/+3
| | | | | PR-URL: https://github.com/nodejs/node/pull/39115 Reviewed-By: Anna Henningsen <anna@addaleax.net>
* src: fix crash in AfterGetAddrInfoAnna Henningsen2021-09-041-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | Remove invalid usage of `Check()`. This addresses: FATAL ERROR: v8::FromJust Maybe value is Nothing. 1: 0x101311bf5 node::Abort() (.cold.1) [/Users/xxx/.nvm/versions/node/v14.17.4/bin/node] 2: 0x1000ade29 node::Abort() [/Users/xxx/.nvm/versions/node/v14.17.4/bin/node] 3: 0x1000adf8f node::OnFatalError(char const*, char const*) [/Users/xxx/.nvm/versions/node/v14.17.4/bin/node] 4: 0x1001f42d0 v8::V8::FromJustIsNothing() [/Users/xxx/.nvm/versions/node/v14.17.4/bin/node] 5: 0x1000268e2 node::cares_wrap::(anonymous namespace)::AfterGetAddrInfo(uv_getaddrinfo_s*, int, addrinfo*)::$_2::operator()(bool, bool) const [/Users/xxx/.nvm/versions/node/v14.17.4/bin/node] 6: 0x10002657c node::cares_wrap::(anonymous namespace)::AfterGetAddrInfo(uv_getaddrinfo_s*, int, addrinfo*) [/Users/xxx/.nvm/versions/node/v14.17.4/bin/node] 7: 0x1009fb388 uv__work_done [/Users/xxx/.nvm/versions/node/v14.17.4/bin/node] 8: 0x100a00453 uv__async_io [/Users/xxx/.nvm/versions/node/v14.17.4/bin/node] 9: 0x100a140cc uv__io_poll [/Users/xxx/.nvm/versions/node/v14.17.4/bin/node] 10: 0x100a009c1 uv_run [/Users/xxx/.nvm/versions/node/v14.17.4/bin/node] 11: 0x10014aca0 node::worker::Worker::Run() [/Users/xxx/.nvm/versions/node/v14.17.4/bin/node] 12: 0x10014e56f node::worker::Worker::StartThread(v8::FunctionCallbackInfo<v8::Value> const&)::$_3::__invoke(void*) [/Users/xxx/.nvm/versions/node/v14.17.4/bin/node] 13: 0x7fff703d42eb _pthread_body [/usr/lib/system/libsystem_pthread.dylib] 14: 0x7fff703d7249 _pthread_start [/usr/lib/system/libsystem_pthread.dylib] 15: 0x7fff703d340d thread_start [/usr/lib/system/libsystem_pthread.dylib] PR-URL: https://github.com/nodejs/node/pull/39735 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
* src: call overload ctor from the original ctorDarshan Sen2021-09-041-7/+2
| | | | | | | | | | | | Call the new constructor overload from the original constructor to reduce code duplication. Signed-off-by: Darshan Sen <darshan.sen@postman.com> PR-URL: https://github.com/nodejs/node/pull/39768 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
* src: add a constructor overload for CallbackScopeDarshan Sen2021-09-044-4/+15
| | | | | | | | | | | | | | This overload accepts the current Environment* as an argument, unlike the other constructor, which accepts an Isolate*. This is useful because we can pass the current Environment* directly instead of recomputing it from the Isolate* inside the constructor. Signed-off-by: Darshan Sen <darshan.sen@postman.com> PR-URL: https://github.com/nodejs/node/pull/39768 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
* src: fix align in cares_wrap.hLuan2021-09-041-4/+4
| | | | | | | | | Co-authored-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/39610 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
* dns: add "tries" option to Resolve optionsLuan Devecchi2021-09-042-6/+20
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/39610 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
* src: allow to negate boolean CLI flagsMichaël Zasso2021-09-046-25/+61
| | | | | | | | | | | | | | | | | | | This change allows all boolean flags to be negated using the `--no-` prefix. Flags that are `true` by default (for example `--deprecation`) are still documented as negations. With this change, it becomes possible to easily flip the default value of a boolean flag and to override the value of a flag passed in the NODE_OPTIONS environment variable. `process.allowedNodeEnvironmentFlags` contains both the negated and non-negated versions of boolean flags. Co-authored-by: Anna Henningsen <anna@addaleax.net> PR-URL: https://github.com/nodejs/node/pull/39023 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* dns: allow `--dns-result-order` to change default dns verbatimOuyang Yadong2021-09-042-0/+8
| | | | | | | | | | | | | | Allow the `--dns-result-order` option to change the default value of verbatim in `dns.lookup()`. This is useful when running Node.js in ipv6-only environments to avoid possible ENETUNREACH errors. PR-URL: https://github.com/nodejs/node/pull/38099 Refs: https://github.com/nodejs/node/issues/31566 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* report: generates report on threads with no isolateslegendecas2021-09-032-15/+14
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/38994 Backport-PR-URL: https://github.com/nodejs/node/pull/39515 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
* src: fix fatal errors when a current isolate not existlegendecas2021-09-031-0/+6
| | | | | | | | | napi_fatal_error and node watchdog trigger fatal error but rather running on a thread that hold no current isolate. PR-URL: https://github.com/nodejs/node/pull/38624 Backport-PR-URL: https://github.com/nodejs/node/pull/39515 Reviewed-By: Michael Dawson <midawson@redhat.com>
* node-api: rtn pending excep on napi_new_instancelegendecas2021-09-031-1/+1
| | | | | | | | | | When there are any JavaScript exceptions pending, `napi_pending_exception` should be returned. PR-URL: https://github.com/nodejs/node/pull/38798 Backport-PR-URL: https://github.com/nodejs/node/pull/39516 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michael Dawson <midawson@redhat.com>
* async_hooks: eliminate native PromiseHookStephen Belanger2021-08-311-284/+0
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/39135 Backport-PR-URL: https://github.com/nodejs/node/pull/39742 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
* src: remove more extra semis from member fnsShelley Vohr2021-08-312-4/+4
| | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/38744 Backport-PR-URL: https://github.com/nodejs/node/pull/39704 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
* buffer: avoid creating the backing store in the threadJames M Snell2021-08-311-2/+2
| | | | | | | | | | Fixes: https://github.com/nodejs/node/issues/37030 PR-URL: https://github.com/nodejs/node/pull/37052 Backport-PR-URL: https://github.com/nodejs/node/pull/39704 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* src: use BaseObject::kInteralFieldCount in BlobJoyee Cheung2021-08-311-1/+2
| | | | | | | | | | Instead of hard-coding the field count. PR-URL: https://github.com/nodejs/node/pull/36991 Backport-PR-URL: https://github.com/nodejs/node/pull/39704 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
* buffer: introduce BlobJames M Snell2021-08-315-0/+461
| | | | | | | | | | | | | The `Blob` object is an immutable data buffer. This is a first step towards alignment with the `Blob` Web API. Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/36811 Backport-PR-URL: https://github.com/nodejs/node/pull/39704 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
* buffer: add base64url encoding optionFilip Skokan2021-08-317-15/+86
| | | | | | | | | | | Backport parts of https://github.com/nodejs/node/commit/dae283d96fd31ad0f30840a7e55ac97294f505ac PR-URL: https://github.com/nodejs/node/pull/36952 Backport-PR-URL: https://github.com/nodejs/node/pull/39702 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* perf_hooks: introduce createHistogramJames M Snell2021-08-319-265/+469
| | | | | | | | | | | | | | Adds a new `perf_hooks.createHistogram()` API for creating histogram instances that allow user recording. Makes Histogram instances cloneable via MessagePort. This allows, for instance, an event loop delay monitor to be running on the main thread while the histogram data can be monitored actively from a worker thread. Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/37155 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* node-api: allow retrieval of add-on file nameGabriel Schulhof2021-08-313-6/+47
| | | | | | | | | | | | | | | | | | | | | | | Unlike JS-only modules, native add-ons are always associated with a dynamic shared object from which they are loaded. Being able to retrieve its absolute path is important to native-only add-ons, i.e. add-ons that are not themselves being loaded from a JS-only module located in the same package as the native add-on itself. Currently, the file name is obtained at environment construction time from the JS `module.filename`. Nevertheless, the presence of `module` is not required, because the file name could also be passed in via a private property added onto `exports` from the `process.dlopen` binding. As an attempt at future-proofing, the file name is provided as a URL, i.e. prefixed with the `file://` protocol. Fixes: https://github.com/nodejs/node-addon-api/issues/449 PR-URL: https://github.com/nodejs/node/pull/37195 Backport-PR-URL: https://github.com/nodejs/node/pull/37327 Co-authored-by: Michael Dawson <mdawson@devrus.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
* src: add --heapsnapshot-near-heap-limit optionJoyee Cheung2021-08-3112-21/+204
| | | | | | | | | | | | | This patch adds a --heapsnapshot-near-heap-limit CLI option that takes heap snapshots when the V8 heap is approaching the heap size limit. It will try to write the snapshots to disk before the program crashes due to OOM. PR-URL: https://github.com/nodejs/node/pull/33010 Refs: https://github.com/nodejs/node/issues/27552 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
* http2: add support for sensitive headersAnna Henningsen2021-08-314-9/+23
| | | | | | | | | | Add support for “sensitive”/“never-indexed” HTTP2 headers. Fixes: https://github.com/nodejs/node/issues/34091 PR-URL: https://github.com/nodejs/node/pull/34145 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com>
* v8: implement v8.stopCoverage()Joyee Cheung2021-08-312-0/+21
| | | | | | | | | | | | | | Add a v8.stopCoverage() API to stop the coverage collection started by NODE_V8_COVERAGE - this would be useful in conjunction with v8.takeCoverage() if the user don't want to emit the coverage at the process exit but still want to collect it on demand at some point. PR-URL: https://github.com/nodejs/node/pull/33807 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Ben Coe <bencoe@gmail.com>
* v8: implement v8.takeCoverage()Joyee Cheung2021-08-312-80/+128
| | | | | | | | | | | | | | | | | | | Add an v8.takeCoverage() API that allows the user to write the coverage started by NODE_V8_COVERAGE to disk on demand. The coverage can be written multiple times during the lifetime of the process, each time the execution counter will be reset. When the process is about to exit, one last coverage will still be written to disk. Also refactors the internal profiler connection code so that we use the inspector response id to identify the profile response instead of using an ad-hoc flag in C++. PR-URL: https://github.com/nodejs/node/pull/33807 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Ben Coe <bencoe@gmail.com>
* src: compare IPv4 addresses in host byte ordercjihrig2021-08-311-2/+4
| | | | | | | | | | | This commit updates compare_ipv4() to use the host byte order. PR-URL: https://github.com/nodejs/node/pull/39096 Fixes: https://github.com/nodejs/node/issues/39074 Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* net: allow net.BlockList to use net.SocketAddress objectsJames M Snell2021-08-312-107/+75
| | | | | | | Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/37917 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* src: move node_binding to modern THROW_ERR*James M Snell2021-08-312-20/+22
| | | | | | | Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/35469 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
* net: add SocketAddress classJames M Snell2021-08-314-0/+201
| | | | | | | Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/37917 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* net: make net.BlockList cloneableJames M Snell2021-08-314-39/+170
| | | | | | | Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/37917 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* src: reduce duplicated boilerplate with new env utility fnJames M Snell2021-08-3133-258/+82
| | | | | | | | | Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/36536 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
* src: allow instances of net.BlockList to be created internallyJames M Snell2021-08-313-0/+17
| | | | | | | | | | Initial PR had it so that user code would create BlockList instances. This sets it up so that instances can be created internally by Node.js PR-URL: https://github.com/nodejs/node/pull/34741 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com>
* net: introduce net.BlockListJames M Snell2021-08-314-2/+765
| | | | | | | | | | | `net.BlockList` provides an object intended to be used by net APIs to specify rules for disallowing network activity with specific IP addresses. This commit adds the basic mechanism but does not add the specific uses. PR-URL: https://github.com/nodejs/node/pull/34625 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
* src: add SocketAddressLRU UtilityJames M Snell2021-08-312-0/+103
| | | | | | | | Adds a LRU cache for information associated with a SocketAddress. PR-URL: https://github.com/nodejs/node/pull/34618 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com>
* cli: add -C alias for --conditions flagGuy Bedford2021-08-311-0/+1
| | | | | | PR-URL: https://github.com/nodejs/node/pull/38755 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Jan Krems <jan.krems@gmail.com>
* fs: allow `position` parameter to be a `BigInt` in read and readSyncraisinten2021-08-311-2/+5
| | | | | | | | | | | | Fixes: https://github.com/nodejs/node/issues/36185 PR-URL: https://github.com/nodejs/node/pull/36190 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>