summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2018-12-21trace_events: move SetupTraceCategoryState into node_trace_events.ccJoyee Cheung
It makes more sense to put it in `internalBinding('trace_events')` instead of in the bootstrapper object. PR-URL: https://github.com/nodejs/node/pull/25128 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-21src: move more process methods initialization in bootstrap/node.jsJoyee Cheung
Instead of: - Writing methods onto the process directly in C++ during `SetupProcessObject()` and overwrite with argument checks later - Or, wrapping and writing them in `internal/process/*.js` Do: - Move the C++ implementations in node_process.cc and mark them static wherever possible - Expose the C++ methods through a new `internalBinding('process_methods')` - Wrap the methods in `internal/process/*.js` in a side-effect-free manner and return them back to `internal/bootstrap/node.js` - Centralize the write to the process object based on conditions in `bootstrap/node.js` So it's easier to see what methods are attached to the process object during bootstrap under what condition and in what order. The eventual goal is to figure out the dependency of process methods and the write/read access to the process object during bootstrap, group these access properly and remove the process properties that should not be exposed to users this way. Also correct the NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE milestone which should be marked before code execution. Refs: https://github.com/nodejs/node/issues/24961 PR-URL: https://github.com/nodejs/node/pull/25127 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-21src,lib: prefer internal/options over process._fooAnna Henningsen
This addresses a couple `TODO` comments and allows us to remove a number of underscored properties from `process` (in a semver-major follow-up). PR-URL: https://github.com/nodejs/node/pull/25063 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-21src: initialize ICU version in per_process::metadata.versionsJoyee Cheung
Instead of - Initialize the ICU versions in JS land after consulting internalBinding('config').hasIntl - Joining the version keys in C++ - Splitting the keys in JS and call into C++ again to get the value for each of the keys Do: - Guard the initialization code behind `NODE_HAVE_I18N_SUPPORT` - Do the initialization in C++ right after ICU data is loaded - Initialize each version directly using ICU functions/constants, and put them in per_process::metadata.versions. These will be copied into `process.versions` naturally later. This way, the initialization of the versions won't be called in worker threads again. PR-URL: https://github.com/nodejs/node/pull/25115 Reviewed-By: Steven R Loomis <srloomis@us.ibm.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-20http: add maxHeaderSize propertycjihrig
This commit exposes the value of --max-http-header-size as a property of the http module. PR-URL: https://github.com/nodejs/node/pull/24860 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Shelley Vohr <codebytere@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-20src: add kUInteger parsingMatteo Collina
This commit adds support for uint64_t option parsing. PR-URL: https://github.com/nodejs/node/pull/24811 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2018-12-20lib: remove internal `util._extends()` usageRuben Bridgewater
This removes all internal calls to the deprecated `_extends()` function. It is slower than `Object.assign()` and the object spread notation since V8 6.8 and using the spread notation often also results in shorter code. PR-URL: https://github.com/nodejs/node/pull/25105 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-12-20lib: switch to object spread where possibleRuben Bridgewater
Use the object spread notation instead of using Object.assign. It is not only easier to read it is also faster as of V8 6.8. PR-URL: https://github.com/nodejs/node/pull/25104 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Yuta Hiroto <hello@hiroppy.me> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-12-20vm: reuse validateString of internal/validatorsZYSzys
PR-URL: https://github.com/nodejs/node/pull/25074 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2018-12-20os: move process.binding('os') to internalBindingbriete
PR-URL: https://github.com/nodejs/node/pull/25087 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-19console: improve inspectOptions validationcjihrig
This commit adds stricter type checking to the inspectOptions option to the Console constructor. PR-URL: https://github.com/nodejs/node/pull/25090 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-19events: simplify stack compare functionRuben Bridgewater
This simplifies the `longestSeqContainedIn()` logic by checking for the first identical occurance of at least three frames instead of the longest one. It also removes an unused argument. PR-URL: https://github.com/nodejs/node/pull/24744 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-12-19util: `format()` now formats bigint and booleansRuben Bridgewater
This is necessary to distinguish them from other data types. PR-URL: https://github.com/nodejs/node/pull/25046 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
2018-12-19process: move POSIX credential accessors into node_credentials.ccJoyee Cheung
Expose the POSIX credential accessors through `internalBinding('credentials')` instead of setting them on the process or bootstrapper object from C++ directly. Also moves `SafeGetEnv` from `internalBinding('util')` to `internalBinding('credentials')` since it's closely related to the credentials. In the JS land, instead of wrapping the bindings then writing to the process object directly in main_thread_only.js, return the wrapped functions back to bootstrap/node.js where they get written to the process object conditionally for clarity. Refs: https://github.com/nodejs/node/issues/24961 PR-URL: https://github.com/nodejs/node/pull/25066 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-18zlib: split JS code as prep for non-zlib-backed streamsAnna Henningsen
Split the `Zlib` class into `ZlibBase` and `Zlib` classes, to facilitate introduction of similar streams with minor implementation differences. PR-URL: https://github.com/nodejs/node/pull/24939 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2018-12-18assert: inspect gettersRuben Bridgewater
While asserting two objects the descriptor is not taken into account. Therefore getters will be triggered as such. This makes sure they are also highlighted in the error message instead of potentially looking identical while the return value of the getter is actually different. PR-URL: https://github.com/nodejs/node/pull/25004 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2018-12-18src: always compile and store code cache for native modulesJoyee Cheung
This patch changes the NativeModuleLoader to always try to find code cache for native modules when it compiles them, and always produce and store the code cache after compilation. The cache map is protected by a mutex and can be accessed by different threads - including the worker threads and the main thread. Hence any thread can reuse the code cache if the native module has already been compiled by another thread - in particular the cache of the bootstrappers and per_context.js will always be hit when a new thread is spun. This results in a ~6% startup overhead in the worst case (when only the main thread is launched without requiring any additional native module - it now needs to do the extra work of finding and storing caches), which balances out the recent improvements by moving the compilation to C++, but it also leads to a ~60% improvement in the best case (when a worker thread is spun and requires a lot of native modules thus hitting the cache compiled by the main thread). PR-URL: https://github.com/nodejs/node/pull/24950 Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-12-17doc,lib,test: capitalize comment sentencesRuben Bridgewater
This activates the eslint capitalize comment rule for comments above 50 characters. PR-URL: https://github.com/nodejs/node/pull/24996 Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-17console: add `inspectOptions` optionRuben Bridgewater
Add an `inspectOptions` option to the `console` constructor. That way it's possible to define all inspection defaults for each `console` instance instead of relying on the `inspect()` defaults. PR-URL: https://github.com/nodejs/node/pull/24978 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
2018-12-17process: improve `--redirect-warnings` handlingRuben Bridgewater
1) Acquiring the file descriptor is not observable anymore when using the `--redirect-warnings` flag. 2) If `fs.appendFile` fails, the warning is now redirected to the default output. 3) The code is smaller and simpler. PR-URL: https://github.com/nodejs/node/pull/24965 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-16tools: enable no-useless-constructor lint rulecjihrig
This commit enables ESLint's no-useless-constructor rule. Note that the documentation examples that only include constructor calls were left in tact. PR-URL: https://github.com/nodejs/node/pull/25055 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-16vm: simplify Script constructor options validationcjihrig
This commit combines two related if statements into an if-else statement. PR-URL: https://github.com/nodejs/node/pull/25054 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-12-16child_process: spawn ignores options in case args is undefinedEduard Bondarenko
spawn method ignores 3-d argument 'options' in case the second one 'args' equals to 'undefined'. Fixes: https://github.com/nodejs/node/issues/24912 PR-URL: https://github.com/nodejs/node/pull/24913 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
2018-12-16util: inspect all prototypesRuben Bridgewater
It is currently difficult to distinguish multiple objects from each other because the prototype is not properly inspected. From now on all prototypes will be inspected, even if we do not fully know how they will look like / what their shape really is. PR-URL: https://github.com/nodejs/node/pull/24974 Fixes: https://github.com/nodejs/node/issues/24917 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-15fs: make writeFile consistent with readFile wrt fdSakthipriyan Vairamani (thefourtheye)
As it is, `readFile` always reads from the current position of the file, if a file descriptor is used. But `writeFile` always writes from the beginning of the file. This patch fixes this inconsistency by making `writeFile` also to write from the current position of the file when used with a file descriptor. PR-URL: https://github.com/nodejs/node/pull/23709 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-12-15src: pass isMainThread into bootstrap/node.js directlyJoyee Cheung
Instead of loading the working binding for the sole purpose of detecting whether we are inside the main thread unconditionally. PR-URL: https://github.com/nodejs/node/pull/25017 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-15net: use strict comparisons for fdcjihrig
This commit removes an eslint-disable comment, and moves file descriptor checks to use strict equality. These checks were using loose equality to support numeric and string file descriptors. However, d9e95d8982ee5b409b36f09c77feccbb1040095c introduced strict validation, making the loose equality checks redundant. PR-URL: https://github.com/nodejs/node/pull/25014 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-15stream: re-use existing `once()` implementationAnna Henningsen
PR-URL: https://github.com/nodejs/node/pull/24991 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2018-12-14util: remove todoRuben Bridgewater
Most people are going to use the existing option and switching the name now comes with a cost which does not seem to justify the improvement. PR-URL: https://github.com/nodejs/node/pull/24982 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2018-12-14lib: remove internalBinding('config').pendingDeprecationJoyee Cheung
Instead use `require('internal/options').getOptionValue('--pending-deprecation')` PR-URL: https://github.com/nodejs/node/pull/24962 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-12-14url: remove an eslint-disable commentcjihrig
Remove an eslint-disable comment by using a strict comparison instead of a Boolean cast. PR-URL: https://github.com/nodejs/node/pull/24995 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
2018-12-14querystring: remove eslint-disablecjihrig
Remove the eslint-disable comments by using a strict comparison instead of a Boolean cast. PR-URL: https://github.com/nodejs/node/pull/24995 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
2018-12-14lib: ensure readable stream flows to endMikko Rantanen
If a readable stream was set up with `highWaterMark 0`, the while-loop in `maybeReadMore_` function would never execute. The while loop now has an extra or-condition for the case where the stream is flowing and there are no items. The or-condition is adapted from the emit-condition of the `addChunk` function. The `addChunk` also contains a check for `state.sync`. However that part of the check was omitted here because the `maybeReadMore_` is executed using `process.nextTick`. `state.sync` is set and then unset within the `read()` function so it should never be in effect in `maybeReadMore_`. Fixes: https://github.com/nodejs/node/issues/24915 PR-URL: https://github.com/nodejs/node/pull/24918 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-12-14util: improve format performanceRuben Bridgewater
This simplifies the `format()` code and significantly improves the performance. PR-URL: https://github.com/nodejs/node/pull/24981 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
2018-12-13process: properly close file descriptor on exitRuben Bridgewater
This makes sure the file descriptor is closed syncronously on exit instead of using the asyncronous version which should not be used on exit. PR-URL: https://github.com/nodejs/node/pull/24972 Refs: https://github.com/nodejs/node/pull/24965/files#r240770314 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-12-13lib: refactor argument validation using validateStringZYSzys
PR-URL: https://github.com/nodejs/node/pull/24960 Refs: https://github.com/nodejs/node/pull/22101 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-12-13src: remove internalBinding('config').warningFileJoyee Cheung
Instead use `require('internal/options')` lazily. Also refactor the call site a bit so that the option is queried only once since it's synchronous anyway. PR-URL: https://github.com/nodejs/node/pull/24959 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-12-13bootstrap: make Buffer and process non-enumerableRuben Bridgewater
This makes sure these two properties are non-enumerable. This aligns them with all other globals that are not enumerable by spec. Refs: https://github.com/nodejs/node/issues/20565 PR-URL: https://github.com/nodejs/node/pull/24874 Refs: https://github.com/nodejs/node/issues/20565 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-12-13worker: drain messages from internal message portYael Hermon
When the worker thread exits, drain the messages also from the internal message port so that the call to 'kDispose' will occur only after all the messages from the worker were processed in the parent, so stdio messages from the worker will be successfully pushed to their target streams in the parent. PR-URL: https://github.com/nodejs/node/pull/24932 Fixes: https://github.com/nodejs/node/issues/24636 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-12-13inspector: move process.binding to internalBindingBeni von Cheni
In places of process.binding('inspector'), migrate code to adapt internalBinding. PR-URL: https://github.com/nodejs/node/pull/24931 Refs: https://github.com/nodejs/node/issues/22160 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-12-12zlib: throw TypeError if callback is missingAnna Henningsen
Get a proper stack trace when no callback is passed. PR-URL: https://github.com/nodejs/node/pull/24929 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Weijia Wang <starkwang@126.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-12-12util: add inspection getter optionRuben Bridgewater
Currently it is not possible to inspect getters. To prevent any side effects this should not become a default but under lots of circumstances it would still be useful to inspect getters. This way it is possible to actively opt into inspecting those. PR-URL: https://github.com/nodejs/node/pull/24852 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-12-11stream: fix end-of-stream for HTTP/2Anna Henningsen
HTTP/2 streams call `.end()` on themselves from their `.destroy()` method, which might be queued (e.g. due to network congestion) and not processed before the stream itself is destroyed. In that case, the `_writableState.ended` property could be set before the stream emits its `'close'` event, and never actually emits the `'finished'` event, confusing the end-of-stream implementation so that it wouldn’t call its callback. This can be fixed by watching for the end events themselves using the existing `'finish'` and `'end'` listeners rather than relying on the `.ended` properties of the `_...State` objects. These properties still need to be checked to know whether stream closure was premature – My understanding is that ideally, streams should not emit `'close'` before `'end'` and/or `'finished'`, so this might be another bug, but changing this would require modifying tests and almost certainly be a breaking change. Fixes: https://github.com/nodejs/node/issues/24456 PR-URL: https://github.com/nodejs/node/pull/24926 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
2018-12-11lib: move DEP0120 to end of lifecjihrig
This deprecation applies to undocumented, rather useless Windows Performance Counter support. PR-URL: https://github.com/nodejs/node/pull/24862 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-12-11module: don't search in require.resolve.pathscjihrig
The paths used by require.resolve() should be treated as starting points for module resolution, and not actually searched. PR-URL: https://github.com/nodejs/node/pull/23683 Fixes: https://github.com/nodejs/node/issues/18408 Refs: https://github.com/nodejs/node/issues/23643 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-12-11lib: remove unused NativeModule/NativeModule wrapsJoyee Cheung
We now compile the native modules in C++ so these are no longer used. PR-URL: https://github.com/nodejs/node/pull/24904 Refs:https://github.com/joyeecheung/node/commit/ bd765d61d7425d82e80bdf2f4f27c0424221837b Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
2018-12-11process: specialize building and storage of process.configJoyee Cheung
Instead of treating config.gypi as a JavaScript file, specialize the processing in js2c and make the serialized result a real JSON string (with 'true' and 'false' converted to boolean values) so we don't have to use a custom deserializer during bootstrap. In addition, store the JSON string separately in NativeModuleLoader, and keep it separate from the map of the builtin source code, so we don't have to put it onto `NativeModule._source` and delete it later, though we still preserve it in `process.binding('natives')`, which we don't use anymore. This patch also makes the map of builtin source code and the config.gypi string available through side-effect-free getters in C++. PR-URL: https://github.com/nodejs/node/pull/24816 Reviewed-By: Gus Caplan <me@gus.host>
2018-12-10assert,util: harden comparisonRuben Bridgewater
The former algorithm used checks which were unsafe. Most of these have been replaced with alternatives that can not be manipulated or fooled that easily. PR-URL: https://github.com/nodejs/node/pull/24831 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
2018-12-10module: use validateString in modules/esmZYSzys
PR-URL: https://github.com/nodejs/node/pull/24868 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-12-10tools: capitalize sentencesRuben Bridgewater
This adds the `capitalized-comments` eslint rule to verify that actual sentences use capital letters as starting letters. It ignores special words and all lines below 62 characters. PR-URL: https://github.com/nodejs/node/pull/24808 Reviewed-By: Sam Ruby <rubys@intertwingly.net> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>