summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2018-10-12tls: make StreamWrap work correctly in "drain" callbackOuyang Yadong
When an instance of StreamWrap is shutting down and a "drain" event is emitted, the instance will abort as its `this[kCurrentShutdownRequest]` is already set. The following test will fail before this commit. PR-URL: https://github.com/nodejs/node/pull/23294 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2018-10-10Revert "module: fix inconsistency between load and _findPath"John-David Dalton
This reverts commit 1b92214 from PR #22382. See the discussion at https://github.com/nodejs/citgm/issues/604 PR-URL: https://github.com/nodejs/node/pull/23228 Refs: https://github.com/nodejs/node/pull/22382 Fixes: https://github.com/nodejs/node/issues/4778 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-10-10async_hooks: add missing async_hooks destroys in AsyncResetBastian Krol
This adds missing async_hooks destroy calls for sockets (in _http_agent.js) and HTTP parsers. We need to emit a destroy in AsyncWrap#AsyncReset before assigning a new async_id when the instance has already been in use and is being recycled, because in that case, we have already emitted an init for the "old" async_id. This also removes a duplicated init call for HTTP parser: Each time a new parser was created, AsyncReset was being called via the C++ Parser class constructor (super constructor AsyncWrap) and also via Parser::Reinitialize. PR-URL: https://github.com/nodejs/node/pull/23272 Fixes: https://github.com/nodejs/node/issues/19859 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-10-10net: use connect() instead of connect.call()Jackson Tian
Use socket.connect() directly. PR-URL: https://github.com/nodejs/node/pull/23289 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Thomas Watson <w@tson.dk> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-10-09util: support BigInt in util.formatMasashi Hirano
`util.format` and `console.log` now support BigInt via the existing format specifiers `%i` and `%d`. PR-URL: https://github.com/nodejs/node/pull/22097 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-10-09benchmark,doc,lib,src,test,tools: fix typosBrandon Smith
PR-URL: https://github.com/nodejs/node/pull/23302 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2018-10-09assert: remove internal errorCache propertyRich Trott
The internal assert module exposed an errorCache property solely for testing. It is no longer necessary. Remove it. PR-URL: https://github.com/nodejs/node/pull/23304 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2018-10-08buffer: unconditionally use internalBindingcjihrig
With the removal of test-buffer-bindingobj-no-zerofill.js, internalBinding can be used unconditionally to assign isAnyArrayBuffer(). PR-URL: https://github.com/nodejs/node/pull/23234 Refs: https://github.com/nodejs/node/issues/22160 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
2018-10-08icu: make process.binding('icu') internalcjihrig
PR-URL: https://github.com/nodejs/node/pull/23234 Refs: https://github.com/nodejs/node/issues/22160 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
2018-10-08streams: refactor ReadableStream asyncIterator creation and a few fixesGus Caplan
Closes: https://github.com/nodejs/node/issues/23041 - Rewrite `ReadableAsyncIterator` class into `ReadableStreamAsyncIteratorPrototype` which contains no constructor and inherits from `%AsyncIteratorPrototype%`. - Rewrite `AsyncIteratorRecord` into dumb function. PR-URL: https://github.com/nodejs/node/pull/23042 Fixes: https://github.com/nodejs/node/issues/23041 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-10-08zlib: simplify flushing mechanismAnna Henningsen
Previously, flushing on zlib streams was implemented through stream 'drain' handlers. This has a number of downsides; in particular, it is complex, and could lead to unpredictable behaviour, since it meant that in a sequence like ```js compressor.write('abc'); compressor.flush(); waitForMoreDataAsynchronously(() => { compressor.write('def'); }); ``` it was not fully deterministic whether the flush happens after the second chunk is written or the first one. This commit replaces this mechanism by one that piggy-backs along the stream’s write queue, using a “special” `Buffer` instance that signals that a flush is currently due. PR-URL: https://github.com/nodejs/node/pull/23186 Reviewed-By: James M Snell <jasnell@gmail.com>
2018-10-08http2: add RFC 8441 extended connect protocol supportJames M Snell
PR-URL: https://github.com/nodejs/node/pull/23284 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-10-08tls: update test & docs for ArrayBuffer/DataViewBeni von Cheni
In tls module, accept ArrayBuffer/DataView in place of isUint8Array in the source code & related test code in "test-tls-basic-validations.js", per the "tls" item in the checklist of the comment in #1826. PR-URL: https://github.com/nodejs/node/pull/23210 Refs: https://github.com/nodejs/node/issues/1826 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com>
2018-10-07zlib: use common owner symbol to access JS wrapperAnna Henningsen
Use the same symbol that other `AsyncWrap` instances also use for accessing the JS wrapper. PR-URL: https://github.com/nodejs/node/pull/23189 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
2018-10-06vm: add dynamic import supportGus Caplan
PR-URL: https://github.com/nodejs/node/pull/22381 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
2018-10-04dns: deprecate passing falsy hostname to dns.lookupOuyang Yadong
We can `dns.lookup` a falsy `hostname` like `dns.lookup(false)` for the reason of backwards compatibility long before(see #13119 for detail). This behavior is undocumented and seems useless in real world apps. We could also make invalid `hostname` throw in the future and the change might be semver-major. Fixes: https://github.com/nodejs/node/issues/13119 PR-URL: https://github.com/nodejs/node/pull/23173 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-10-04process: allow reading from stdout/stderr socketsAnna Henningsen
Allow reading from stdio streams that are conventionally associated with process output, since this is only convention. This involves disabling the oddness around closing stdio streams. Its purpose is to prevent the file descriptors 0 through 2 from being closed, since doing so can lead to information leaks when new file descriptors are being opened; instead, not doing anything seems like a more reasonable choice. Fixes: https://github.com/nodejs/node/issues/21203 PR-URL: https://github.com/nodejs/node/pull/23053 Reviewed-By: James M Snell <jasnell@gmail.com>
2018-10-04Revert "tty: make _read throw ERR_TTY_WRITABLE_NOT_READABLE"Anna Henningsen
This reverts commit 91eec00ca20a54b1dc010cfc2fb34bc2f39eab6b. Refs: https://github.com/nodejs/node/pull/21654 Refs: https://github.com/nodejs/node/issues/21203 PR-URL: https://github.com/nodejs/node/pull/23053 Reviewed-By: James M Snell <jasnell@gmail.com>
2018-10-04src: name EmbededderGraph edges and use class names for nodesJoyee Cheung
This patch: - Refactors the `MemoryRetainer` API so that the impementer no longer calls `TrackThis()` that sets the size of node on the top of the stack, which may be hard to understand. Instead now they implements `SelfSize()` to provide their self sizes. Also documents the API in the header. - Refactors `MemoryTracker` so it calls `MemoryInfoName()` and `SelfSize()` of `MemoryRetainer` to retrieve info about them, and separate `node_names` and `edge_names` so the edges can be properly named with reference names and the nodes can be named with class names. (Previously the nodes are named with reference names while the edges are all indexed and appear as array elements). - Adds `SET_MEMORY_INFO_NAME()`, `SET_SELF_SIZE()` and `SET_NO_MEMORY_INFO()` convenience macros - Fixes a few `MemoryInfo` calls in some `MemoryRetainers` to track their references properly. - Refactors the heapdump tests to check both node names and edge names, distinguishing between wrapped JS nodes (without prefixes) and embedder wrappers (prefixed with `Node / `). PR-URL: https://github.com/nodejs/node/pull/23072 Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-10-04zlib: move, rename, document internal params() cbAnna Henningsen
Give the callback a more specific name, explain what it does and why it is necessary, and move it to a location much closer to its use site. PR-URL: https://github.com/nodejs/node/pull/23187 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-10-04bootstrapper: move internalBinding to NativeModuleGus Caplan
internalBinding is used so often that it should just automatically be available for usage in internals. PR-URL: https://github.com/nodejs/node/pull/23025 Refs: https://github.com/nodejs/node/commit/2a9eb31 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-10-03src: use JS inheritance for `AsyncWrap`Anna Henningsen
For all classes descending from `AsyncWrap`, use JS inheritance instead of manually adding methods to the individual classes. This allows cleanup of some code around transferring handles over IPC. PR-URL: https://github.com/nodejs/node/pull/23094 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-10-03http2: don't send trailers on a closed connectionAndré Cruz
There is a race condition between onStreamCloseResponse(), which removes the wantTrailers listener, and Http2Stream.close(), which will invalidate the connection. IE, sendTrailers can be called on a closed connection which would crash with a: Error [ERR_HTTP2_INVALID_STREAM]: The stream has been destroyed PR-URL: https://github.com/nodejs/node/pull/23146 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-10-03crypto: extract throwInvalidArgType functionDaniel Bevenius
This commit extracts the throwing of ERR_INVALID_ARG_TYPE which is done in identical ways in a few places in cipher.js. The motivation for this is that I think it improves readability enough to warrant a commit even though I'm aware that we should avoid commits with only these sort of refactoring. PR-URL: https://github.com/nodejs/node/pull/22947 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-10-02util: change %o depth defaultRuben Bridgewater
Since the default for depth is changed to `20` it is logical to change the %o default as well. It will now always use the default depth. PR-URL: https://github.com/nodejs/node/pull/17907 Refs: https://github.com/nodejs/node/issues/12693 PR-URL: https://github.com/nodejs/node/pull/22846 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
2018-10-02util: change util.inspect depth defaultRuben Bridgewater
The current default is not ideal in most use cases. Therefore it is changed to inspect objects to a maximum depth of 20 in case util.inspect is called with it's defaults. The default is kept at 2 when using console.log() and similar in the repl. PR-URL: https://github.com/nodejs/node/pull/17907 Refs: https://github.com/nodejs/node/issues/12693 PR-URL: https://github.com/nodejs/node/pull/22846 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
2018-10-02repl: do not swallow errors in nested REPLsRich Trott
For tab completion, a REPLServer instance will sometimes create another REPLServer instance. If a callback is sent to the `.complete()` function and that callback throws an error, it will be swallowed by the nested REPLs domain. Re-throw the error so that processes don't silently exit without any indication of an error (including a status code). Fixes: https://github.com/nodejs/node/issues/21586 PR-URL: https://github.com/nodejs/node/pull/23004 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-10-02util: handle null prototype on inspectAnto Aravinth
This makes sure the `null` prototype is always detected properly. PR-URL: https://github.com/nodejs/node/pull/22331 Fixes: https://github.com/nodejs/node/issues/22141 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
2018-10-02crypto: add support for PEM-level encryptionTobias Nießen
This adds support for PEM-level encryption as defined in RFC 1421. PEM-level encryption is intentionally unsupported for PKCS#8 private keys since PKCS#8 defines a newer encryption format. PR-URL: https://github.com/nodejs/node/pull/23151 Refs: https://github.com/nodejs/node/pull/22660 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-10-02stream: improve buffer list inspectionRuben Bridgewater
This makes sure the indentation level is correct, no matter if the inspected buffer list is inspected on a deeper level and custom inspect options are now passed through to the actual inspection. PR-URL: https://github.com/nodejs/node/pull/23109 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-10-02timers: use custom inspection for linked listsRuben Bridgewater
Inspecting linked lists is something that is not really useful. Instead, just use a custom inspection function and hide everything besides the first level. PR-URL: https://github.com/nodejs/node/pull/23108 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2018-10-01cluster: move handle tracking out of utilscjihrig
internal/cluster/utils.js exported a handles object, which was used in a test. That test, test-cluster-disconnect-handles.js, was removed in https://github.com/nodejs/node/pull/12495. This commit moves the handles object to the only file in the codebase that still uses it. PR-URL: https://github.com/nodejs/node/pull/23131 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-10-01util: set `super_` property to non-enumerableRuben Bridgewater
Using `util.inherits()` adds a `super_` property to the constructor and inspecting that constructor is going to show that property even though it's not useful for the user. Therefore the property is now set as non-enumerable and such entries are not visible by default when using `console.log()` or `util.inspect()`. PR-URL: https://github.com/nodejs/node/pull/23107 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-09-30cluster: use Map to track handles in mastercjihrig
PR-URL: https://github.com/nodejs/node/pull/23125 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com>
2018-09-30cluster: use Map to track handles in cluster childcjihrig
PR-URL: https://github.com/nodejs/node/pull/23125 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com>
2018-09-30cluster: use Map to track indexescjihrig
PR-URL: https://github.com/nodejs/node/pull/23125 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com>
2018-09-30cluster: use Map to track round robin workerscjihrig
PR-URL: https://github.com/nodejs/node/pull/23125 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com>
2018-09-30cluster: use Map to track callbackscjihrig
Use a Map to avoid delete operations in callback tracking. PR-URL: https://github.com/nodejs/node/pull/23125 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com>
2018-09-28lib: reword help text for clarityGireesh Punathil
modified the `-` CLI option help text for improved readability. PR-URL: https://github.com/nodejs/node/pull/23016 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-09-27fs: consistently return symlink type from readdirKlaus Meinhardt
Use 'lstat' to determine type of directory entry. This is more consistent with the type returned from the readdir binding. Also use 'path.join' over 'path.resolve' because 'name' is not absolute. PR-URL: https://github.com/nodejs/node/pull/22808 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Bryan English <bryan@bryanenglish.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2018-09-27crypto: downgrade DEP0115 to `--pending-deprecation` onlyAnna Henningsen
Aliases are very cheap to maintain, so an unconditional runtime deprecation that affects existing ecosystem code is not a good idea. This commit turns the runtime deprecation into a `--pending-deprecation` one. Fixes: https://github.com/nodejs/node/issues/23013 PR-URL: https://github.com/nodejs/node/pull/23017 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-09-27assert: add comments for diff algorithmRuben Bridgewater
It became hard to follow what was actually happening in the algorithm. This adds comments to improve the situation. PR-URL: https://github.com/nodejs/node/pull/23048 Refs: https://github.com/nodejs/node/issues/22763 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Shingo Inoue <leko.noor@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-09-27assert: reduce diff noiseRuben Bridgewater
Assertion errors that produce a diff show a diff for identical entries in case one side of the comparison has more object properties than the other one. Those lines are now taken into account and will not show up as diverging lines anymore. Refs: https://github.com/nodejs/node/issues/22763 PR-URL: https://github.com/nodejs/node/pull/23048 Refs: https://github.com/nodejs/node/issues/22763 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Shingo Inoue <leko.noor@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-09-27assert: switch `inputs` to `values`Ruben Bridgewater
The wording seems clearer when using `values` instead of `inputs`. PR-URL: https://github.com/nodejs/node/pull/23056 Refs: https://github.com/nodejs/node/issues/22763 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-09-27assert: improve the strict equal messagesRuben Bridgewater
In case reference (un)equal objects fail in assertion, it should be clear that it is about the reference equality and not about the object properties. This is fixed by improving the message in such cases. Refs: https://github.com/nodejs/node/issues/22763 PR-URL: https://github.com/nodejs/node/pull/23056 Refs: https://github.com/nodejs/node/issues/22763 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-09-27lib: change abstract equal to strict equalZYSzys
PR-URL: https://github.com/nodejs/node/pull/22974 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: John-David Dalton <john.david.dalton@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-09-26errors: use ERR_OUT_OF_RANGE for index errorsRich Trott
Remove ERR_INDEX_OUT_OF_RANGE in favor of ERR_OUT_OF_RANGE which is capable of providing more detail. (In one instance, use ERR_BUFFER_OUT_OF_BOUNDS which is more accurate in that one instance.) PR-URL: https://github.com/nodejs/node/pull/22969 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Weijia Wang <starkwang@126.com>
2018-09-26http2: close fd in doSendFileFD()cjihrig
This commit closes the file descriptor in two code paths that return from doSendFileFD(). PR-URL: https://github.com/nodejs/node/pull/23047 Fixes: https://github.com/nodejs/node/issues/23029 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-09-26worker: reduce `MessagePort` prototype to documented APIAnna Henningsen
`MessagePort` is special because it has to be a C++ API that is exposed to userland. Therefore, there is a number of internal methods on its native prototype; this commit reduces this set of methods to only what is documented in the API. PR-URL: https://github.com/nodejs/node/pull/23037 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-09-26worker: hide MessagePort init function behind symbolAnna Henningsen
This reduces unintended exposure of internals. PR-URL: https://github.com/nodejs/node/pull/23037 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>