summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2019-04-03lib: remove Atomics.wakeGus Caplan
PR-URL: https://github.com/nodejs/node/pull/27033 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2019-04-04process: patch more process properties during pre-executionJoyee Cheung
Delay the creation of process properties that depend on runtime states and properties that should not be accessed during bootstrap and patch them during pre-execution: - process.argv - process.execPath - process.title - process.pid - process.ppid - process.REVERT_* - process.debugPort PR-URL: https://github.com/nodejs/node/pull/26945 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2019-04-03lib: force using primordials for JSON, Math and ReflectMichaël Zasso
Use the "no-restricted-globals" ESLint rule to lint for it. PR-URL: https://github.com/nodejs/node/pull/27027 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-04-03module: fix repl require calling the same file againRuben Bridgewater
This makes sure multiple require calls will not fail in case a file was created after the first attempt. PR-URL: https://github.com/nodejs/node/pull/26928 Fixes: https://github.com/nodejs/node/issues/26926 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Jan Krems <jan.krems@gmail.com>
2019-04-03readline: make Symbol.asyncIterator support stableMatteo Collina
PR-URL: https://github.com/nodejs/node/pull/26989 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Masashi Hirano <shisama07@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2019-04-03stream: make Symbol.asyncIterator support stableMatteo Collina
PR-URL: https://github.com/nodejs/node/pull/26989 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Masashi Hirano <shisama07@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2019-04-03dgram: add support for UDP connected socketsSantiago Gimeno
Added the `dgram.connect()` and `dgram.disconnect()` methods that associate/disassociate a udp socket to/from a remote address. It optimizes for cases where lots of packets are sent to the same address. Also added the `dgram.remoteAddress()` method to retrieve the associated remote address. PR-URL: https://github.com/nodejs/node/pull/26871 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2019-04-03process: run RunBootstrapping in CreateEnvironmentJoyee Cheung
Also creates `CreateMainEnvironment` to encapsulate the code creating the main environment from the provided Isolate data and arguments. PR-URL: https://github.com/nodejs/node/pull/26788 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com>
2019-04-03path: refactor for less indentationRuben Bridgewater
This just switches the statements in a way that it reduces the overall indentation. The function has a very deep indentation in general and this should improve the readability. PR-URL: https://github.com/nodejs/node/pull/26917 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2019-04-03util: improve error property inspectionRuben Bridgewater
This makes sure that errors that contain extra properties show those properties on a separate line. PR-URL: https://github.com/nodejs/node/pull/26984 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2019-04-03util: improve `inspect()` compact number modeRuben Bridgewater
This fixes a proportion calculation for lots of short array entries with at least one bigger one that alone makes up for more than one fifth of all other entries together. PR-URL: https://github.com/nodejs/node/pull/26984 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2019-04-03module: mark DEP0019 as End-of-LifeRuben Bridgewater
In certain cases, `require('.')` could resolve outside the package directory. This behavior has been removed. PR-URL: https://github.com/nodejs/node/pull/26973 Refs: https://github.com/nodejs/node/pull/3384 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2019-04-03util: `inspect()` should not exceed `breakLength`Ruben Bridgewater
Using `util.inspect()` with the `compact` option set to a number could result in output that exceeded the `breakLength` option. This change makes sure that limit is taken into account. PR-URL: https://github.com/nodejs/node/pull/26914 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2019-04-02fs: remove experimental warning for fs.promisesAnna Henningsen
This has been warning for long enough, without any API changes in the last few months. PR-URL: https://github.com/nodejs/node/pull/26581 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-04-01dns: refactor lib/internal/dns/utils.jsRich Trott
* alphabetize contenst of `resolverKeys` array * less line-wrapping for increased code clarity PR-URL: https://github.com/nodejs/node/pull/27006 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-03-31stream: do not unconditionally call `_read()` on `resume()`Anna Henningsen
`readable.resume()` calls `.read(0)`, which in turn previously set `needReadable = true`, and so a subsequent `.read()` call would call `_read()` even though enough data was already available. This can lead to elevated memory usage, because calling `_read()` when enough data is in the readable buffer means that backpressure is not being honoured. Fixes: https://github.com/nodejs/node/issues/26957 PR-URL: https://github.com/nodejs/node/pull/26965 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-03-31module: simpler esm loadingRuben Bridgewater
This simplifies loading the experimental modules. Instead of always checking for them we should eagerly load the functions in case the experimental modules flag is passed through. PR-URL: https://github.com/nodejs/node/pull/26974 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com>
2019-03-30worker: use copy of process.envAnna Henningsen
Instead of sharing the OS-backed store for all `process.env` instances, create a copy of `process.env` for every worker that is created. The copies do not interact. Native-addons do not see modifications to `process.env` from Worker threads, but child processes started from Workers do default to the Worker’s copy of `process.env`. This makes Workers behave like child processes as far as `process.env` is concerned, and an option corresponding to the `child_process` module’s `env` option is added to the constructor. Fixes: https://github.com/nodejs/node/issues/24947 PR-URL: https://github.com/nodejs/node/pull/26544 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2019-03-30readline: replace quadratic regex with linear oneThomas
Simplify regular expression in _wordLeft and _deleteWordLeft readline methods. PR-URL: https://github.com/nodejs/node/pull/26778 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2019-03-30buffer: use stricter `from()` input validationRuben Bridgewater
So far we did not throw an error for all types of invalid input. Functions do not return a buffer anymore and `number` and `symbol` validation is also improved. PR-URL: https://github.com/nodejs/node/pull/26825 Fixes: https://github.com/nodejs/node/issues/26741 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2019-03-30benchmark,lib: change var to constRuben Bridgewater
Refs: https://github.com/nodejs/node/pull/26679 PR-URL: https://github.com/nodejs/node/pull/26915 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Refael Ackermann <refack@gmail.com>
2019-03-30net: remove usage of require('util')dnlup
Use `require('internal/util/inspect').inspect`, `require('internal/util/debuglog').debuglog`, `require('internal/util').deprecate` and `Object.setPrototypeOf` instead of `require('util')`. Fix test in `test/parallel/test-net-access-byteswritten.js` to do not check the `super_` property that was set when using `require('util').inherits`. Refs: https://github.com/nodejs/node/issues/26546 Refs: https://github.com/nodejs/node/pull/26896 PR-URL: https://github.com/nodejs/node/pull/26920 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2019-03-30util: add subclass and null prototype support for errors in inspectRuben Bridgewater
This adds support to visualize the difference between errors with null prototype or subclassed errors. This has a couple safeguards to be sure that the output is not intrusive. PR-URL: https://github.com/nodejs/node/pull/26923 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2019-03-30url: add ws: and wss: to slashedProtocol setLuigi Pinca
Fix cases where the pathname is incorrectly parsed as `null`. PR-URL: https://github.com/nodejs/node/pull/26941 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
2019-03-30esm: use primordialsMyles Borins
Converted uses of Object and Map to use frozen built in primordials. PR-URL: https://github.com/nodejs/node/pull/26954 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2019-03-29src: do not call into JS in the maxAsyncCallStackDepthChanged interruptJoyee Cheung
If Debugger.setAsyncCallStackDepth is sent during bootstrap, we cannot immediately call into JS to enable the hooks, which could interrupt the JS execution of bootstrap. So instead we save the notification in the inspector agent if it's sent in the middle of bootstrap, and process the notification later here. Refs: https://github.com/nodejs/node/issues/26798 PR-URL: https://github.com/nodejs/node/pull/26935 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
2019-03-29dns: make dns.promises enumerablecjihrig
PR-URL: https://github.com/nodejs/node/pull/26592 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2019-03-29dns: remove dns.promises experimental warningcjihrig
PR-URL: https://github.com/nodejs/node/pull/26592 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2019-03-29repl: remove usage of require('util') in `repl.js`dnlup
Use `require('internal/util/inspect').inspect` and `require('internal/util/debuglog').debuglog` instead of `require('util').inspect` and `require('util').debuglog`. Refs: https://github.com/nodejs/node/issues/26546 PR-URL: https://github.com/nodejs/node/pull/26820 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Masashi Hirano <shisama07@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
2019-03-29path: remove dead codeRuben Bridgewater
A couple of code parts could not be reached due to resolving the path in the beginning. That "normalizes" the path in a way that some code branches became obsolete. PR-URL: https://github.com/nodejs/node/pull/26916 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2019-03-29util: fix map entries inspectionRuben Bridgewater
This makes sure the arrays returned by Map#entries() are handled as any other array instead of just visualizing the entries as array. Therefore options should have an impact on the arrays. PR-URL: https://github.com/nodejs/node/pull/26918 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2019-03-28crypto: add crypto.sign() and crypto.verify()Brian White
These methods are added primarily to allow signing and verifying using Ed25519 and Ed448 keys, which do not support streaming of input data. However, any key type can be used with these new APIs, to allow better performance when only signing/verifying a single chunk. Fixes: https://github.com/nodejs/node/issues/26320 PR-URL: https://github.com/nodejs/node/pull/26611 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2019-03-28tls: return an OpenSSL error from renegotiateSam Roberts
A generic error lacks any of the context or detail of the underlying OpenSSL error, so throw from C++, and report the OpenSSL error to the callback. PR-URL: https://github.com/nodejs/node/pull/26868 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2019-03-28errors: make range mandatory in ERR_OUT_OF_RANGERuben Bridgewater
So far the range argument was allowed to be undefined. This is not used in the codebase anymore and therefore it is best to make it mandatory for the best user experience. PR-URL: https://github.com/nodejs/node/pull/26924 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-03-28util: only the first line of the error messageSimon Zünd
V8 extends the error message for JSON#stringify when encountering circular structures. The first line of the new error message is equivalent to the old error message and stays the same across all circular structure errors. PR-URL: https://github.com/nodejs/node/pull/26685 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
2019-03-28crypto: allow undefined for saltLength and paddingTobias Nießen
PR-URL: https://github.com/nodejs/node/pull/26921 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-03-28process: remove protection for SyncWriteStream destroy in stdioMatteo Collina
https://github.com/nodejs/node/pull/26691 introduced an if to protect against SyncWriteStream not using the default .destroy() mechanism. This change removes that as SyncWriteStream now use standard .destroy(). See: https://github.com/nodejs/node/pull/26691 PR-URL: https://github.com/nodejs/node/pull/26902 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-03-28util: improve proxy inspectionRuben Bridgewater
This makes sure the brace is actually handled as any other brace. It was handled differently so far than any other brace and that had an impact on how the output would be formatted. PR-URL: https://github.com/nodejs/node/pull/26919 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-03-28path: fix win32 parse regressionRuben Bridgewater
This fixes the parse function for single character input that are not a path separator. PR-URL: https://github.com/nodejs/node/pull/26912 Fixes: https://github.com/nodejs/node/issues/26911 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2019-03-28crypto: rename generateKeyPairEdDSATobias Nießen
Now that support for X25519 and X448 has been added, this function is not used exclusively for EdDSA keys anymore. PR-URL: https://github.com/nodejs/node/pull/26900 Refs: https://github.com/nodejs/node/pull/26774 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
2019-03-27console: remove unreachable codeRich Trott
In the current code, line 497 checks if `item` is `null` or `undefined`. However, `item` is guaranteed to be a non-null object or function at that point. * Lines 484/485 set `primitive` to `true` if `item` is null or undefined. * Line 486 skips line 497 if `primitive` is true (which it will always be if `item` is null or undefined) and `properties` is undefined. So the only way to get to line 497 when `item` is null or undefined is if `properties` is specified. * Line 494 skips line 497 if `primitive` is true (which it will always be if `item` is null or undefined) and `properties` are specified (which will always be the case or else this `else` block is skipped.) Here are the current lines 484 through 497: const primitive = item === null || (typeof item !== 'function' && typeof item !== 'object'); if (properties === undefined && primitive) { hasPrimitives = true; valuesKeyArray[i] = _inspect(item); } else { const keys = properties || ObjectKeys(item); for (const key of keys) { if (map[key] === undefined) map[key] = []; if ((primitive && properties) || !hasOwnProperty(item, key)) map[key][i] = ''; else map[key][i] = item == null ? item : _inspect(item[key]); This change removes the unnecessary ternary in that final line, simplifying it to: map[key][i] = _inspect(item[key]); PR-URL: https://github.com/nodejs/node/pull/26906 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Yuta Hiroto <hello@hiroppy.me> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
2019-03-27util: don't set the prototype of callbackified functionsRuben Bridgewater
Using `util.callbackify()` should not set the prototype for the returned function to the one from the input function. It could cause confusion while debugging otherwise. PR-URL: https://github.com/nodejs/node/pull/26893 Fixes: https://github.com/nodejs/node/issues/26890 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2019-03-27util: rename callbackified functionRuben Bridgewater
This makes sure the function returned by `util.callbackify()` has a new name that is not identical to the inputs function name. PR-URL: https://github.com/nodejs/node/pull/26893 Fixes: https://github.com/nodejs/node/issues/26890 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2019-03-27util: increase function length when using `callbackify()`Ruben Bridgewater
The returned function from `util.callbackify()` should increase the `length` property by one due to the added callback. PR-URL: https://github.com/nodejs/node/pull/26893 Fixes: https://github.com/nodejs/node/issues/26890 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2019-03-27esm: phase two of new esm implementationguybedford
This PR updates the current `--experimental-modules` implementation based on the work of the modules team and reflects Phase 2 of our new modules plan. The largest differences from the current implementation include * `packge.type` which can be either `module` or `commonjs` - `type: "commonjs"`: - `.js` is parsed as commonjs - default for entry point without an extension is commonjs - `type: "module"`: - `.js` is parsed as esm - does not support loading JSON or Native Module by default - default for entry point without an extension is esm * `--entry-type=[mode]` - allows you set the type on entry point. * A new file extension `.cjs`. - this is specifically to support importing commonjs in the `module` mode. - this is only in the esm loader, the commonjs loader remains untouched, but the extension will work in the old loader if you use the full file path. * `--es-module-specifier-resolution=[type]` - options are `explicit` (default) and `node` - by default our loader will not allow for optional extensions in the import, the path for a module must include the extension if there is one - by default our loader will not allow for importing directories that have an index file - developers can use `--es-module-specifier-resolution=node` to enable the commonjs specifier resolution algorithm - This is not a “feature” but rather an implementation for experimentation. It is expected to change before the flag is removed * `--experimental-json-loader` - the only way to import json when `"type": "module"` - when enable all `import 'thing.json'` will go through the experimental loader independent of mode - based on https://github.com/whatwg/html/issues/4315 * You can use `package.main` to set an entry point for a module - the file extensions used in main will be resolved based on the `type` of the module Refs: https://github.com/nodejs/modules/blob/master/doc/plan-for-new-modules-implementation.md Refs: https://github.com/GeoffreyBooth/node-import-file-specifier-resolution-proposal Refs: https://github.com/nodejs/modules/pull/180 Refs: https://github.com/nodejs/ecmascript-modules/pull/6 Refs: https://github.com/nodejs/ecmascript-modules/pull/12 Refs: https://github.com/nodejs/ecmascript-modules/pull/28 Refs: https://github.com/nodejs/modules/issues/255 Refs: https://github.com/whatwg/html/issues/4315 Refs: https://github.com/w3c/webcomponents/issues/770 Co-authored-by: Myles Borins <MylesBorins@google.com> Co-authored-by: John-David Dalton <john.david.dalton@gmail.com> Co-authored-by: Evan Plaice <evanplaice@gmail.com> Co-authored-by: Geoffrey Booth <webmaster@geoffreybooth.com> Co-authored-by: Michaël Zasso <targos@protonmail.com> PR-URL: https://github.com/nodejs/node/pull/26745 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Ben Coe <bencoe@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
2019-03-27benchmark,doc,lib: capitalize more commentsRuben Bridgewater
PR-URL: https://github.com/nodejs/node/pull/26849 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2019-03-27module: throw an error for invalid package.json main entriesRuben Bridgewater
We currently ignore invalid `main` entries in package.json files. This does not seem to be very user friendly as it's certainly an error if the `main` entry is not a valid file name. So instead of trying to resolve the file otherwise, throw an error immediately to improve the user experience. To keep it backwards compatible `index.js` files in the same directory as the `package.json` will continue to be resolved instead but that behavior is now deprecated. PR-URL: https://github.com/nodejs/node/pull/26823 Fixes: https://github.com/nodejs/node/issues/26588 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2019-03-27lib: consolidate arrayBufferView validationRuben Bridgewater
There are lots of places that validate for arrayBufferView and we have multiple functions that do the same thing. Instead, move the validation into `internal/validators` so all files can use that instead. There are more functions throughout the code that do the same but it takes some more work to fully consolidate all of those. PR-URL: https://github.com/nodejs/node/pull/26809 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-03-27crypto: remove obsolete encoding checkRuben Bridgewater
This renames the parameters for clarity and removes the check for undefined encoding. That will always default to `utf8`. PR-URL: https://github.com/nodejs/node/pull/26809 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-03-27http2: rename function for clarityRuben Bridgewater
The function does not only validate the input but it causes side effects by adding default options to the input object in case the option is not set. PR-URL: https://github.com/nodejs/node/pull/26809 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>