summaryrefslogtreecommitdiff
path: root/lib/repl.js
AgeCommit message (Collapse)Author
2019-02-11repl: add repl.setupHistory for programmatic replLance Ball
Adds a `repl.setupHistory()` instance method so that programmatic REPLs can also write history to a file. This change also refactors all of the history file management to `lib/internal/repl/history.js`, cleaning up and simplifying `lib/internal/repl.js`. PR-URL: https://github.com/nodejs/node/pull/25895 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2019-02-08deps: update acorn to 6.0.7Michaël Zasso
acorn and acorn-walk are now published as two different packages. Put them both in subdirectories of `deps/acorn`. Adapt the REPL's recoverable error detection to use the new API for extending acorn parsers. PR-URL: https://github.com/nodejs/node/pull/25844 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-02-06repl: remove obsolete buffer clearingRuben Bridgewater
It is checked if an command buffer exists or not. This code branch can only be reached if none exist, so there's no need to clear that buffer again. PR-URL: https://github.com/nodejs/node/pull/25731 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-02-06repl: fix eval return valueRuben Bridgewater
In case no error has occurred during the evaluation of some code, `undefined` has been returned in some cases as error argument instead of `null`. This is fixed by this patch. PR-URL: https://github.com/nodejs/node/pull/25731 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-02-06repl: simplify and improve completionRuben Bridgewater
The completion lists used a hand crafted list of global entries that was redundant due to also using the actual global properties for tab completion. Those entries ended up in an separated completion group which did not seem useful. PR-URL: https://github.com/nodejs/node/pull/25731 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-01-02repl: indicate if errors are thrown or notRuben Bridgewater
Currently an error is printed identical, no matter if it is just inspected or if the error is thrown inside of the REPL. This makes sure we are able to distinguish these cases. PR-URL: https://github.com/nodejs/node/pull/25253 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Anna Henningsen <anna@addaleax.net>
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-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-05Revert "lib: repl multiline history support"Ruben Bridgewater
This reverts commit dd7a3d246ded89cd0c910231c9adec279e72f9a9. PR-URL: https://github.com/nodejs/node/pull/24804 Refs: https://github.com/nodejs/node/issues/24231 Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2018-12-05Revert "repl: handle buffered string logic on finish"Ruben Bridgewater
This reverts commit eb42c1eb4f2502433a22c49ede9e657fb6cd86e0. PR-URL: https://github.com/nodejs/node/pull/24804 Refs: https://github.com/nodejs/node/issues/24231 Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2018-12-05lib: use ES6 class inheritance styleRuben Bridgewater
PR-URL: https://github.com/nodejs/node/pull/24755 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-12-05lib: remove `inherits()` usageRuben Bridgewater
This switches all `util.inherits()` calls to use `Object.setPrototypeOf()` instead. In fact, `util.inherits()` is mainly a small wrapper around exactly this function while adding the `_super` property on the object as well. Refs: #24395 PR-URL: https://github.com/nodejs/node/pull/24755 Refs: https://github.com/nodejs/node/issues/24395 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-11-19repl: handle buffered string logic on finishAnto Aravinth
Looks like `clearBufferedCommand` will be called on almost all flows. Hence history was broken. PR-URL: https://github.com/nodejs/node/pull/24389 Fixes: https://github.com/nodejs/node/issues/24385 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2018-11-14Revert "util: change util.inspect depth default"Gus Caplan
This reverts commit ac7450a09a4c167cd43c14d7c88721d22f077529. This fully reverts the changes to util.inspect depth. It has caused breakage in logging to existing apps, and even something as simple as `console.log(require)` will cause >1m freezes. I've heard nothing but negative feedback (seriously not a single person has expressed anything positive about this change) and personally i find this change extremely annoying. PR-URL: https://github.com/nodejs/node/pull/24326 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
2018-11-07src: cache the result of GetOptions() in JS landJoyee Cheung
Instead of calling into C++ each time we need to check the value of a command line option, cache the option map in a new `internal/options` module for faster access to the values in JS land. PR-URL: https://github.com/nodejs/node/pull/24091 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Refael Ackermann <refack@gmail.com>
2018-11-06repl: remove unused catch bindingscjihrig
PR-URL: https://github.com/nodejs/node/pull/24079 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Wyatt Preul <wpreul@gmail.com>
2018-11-05lib:fix grammar error and make it clearer for commentsMaleDong
1) Should be passive voice instead of `can overridden`. 2) Change the order of the two sentences to make it more clear about 'What can be overridden' instead of 'Can be overridden'. PR-URL: https://github.com/nodejs/node/pull/23799 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-11-03repl: use promise#finallyWeijia Wang
PR-URL: https://github.com/nodejs/node/pull/23971 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-11-02lib: repl multiline history supportAnto Aravinth
PR-URL: https://github.com/nodejs/node/pull/22153 Reviewed-By: John-David Dalton <john.david.dalton@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-10-22repl: migrate from process.binding('config') to getOptions()Jose Bucio
PR-URL: https://github.com/nodejs/node/pull/23684 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2018-10-13repl: remove unused variable e from try catchKhalid Adil
PR-URL: https://github.com/nodejs/node/pull/23449 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@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-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-09-05repl: remove duplicate util bindingcjihrig
PR-URL: https://github.com/nodejs/node/pull/22675 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-09-05util: make util binding internalcjihrig
Refs: https://github.com/nodejs/node/issues/22160 PR-URL: https://github.com/nodejs/node/pull/22675 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-08-27repl: refactor ERR_SCRIPT_EXECUTION_INTERRUPTED stack handlingRuben Bridgewater
The stack was removed later on instead of never being attached in the first place. PR-URL: https://github.com/nodejs/node/pull/22436 Refs: https://github.com/nodejs/node/issues/20253 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-08-27repl: improve error outputRuben Bridgewater
1) Currently extra properties on an error will be ignored, if thrown. This information will from now on be visible. 2) In case someone threw a non error object it would have resulted in `[object Object]`. Instead, the full object will now be visible. 3) Some cases were not detected properly as error before and "Thrown: " was visible before. That is now fixed. PR-URL: https://github.com/nodejs/node/pull/22436 Refs: https://github.com/nodejs/node/issues/20253 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-08-23repl: tab auto complete big arraysRuben Bridgewater
Due to a new API it's possible to skip the indices. That allows to use auto completion with big (typed) arrays. PR-URL: https://github.com/nodejs/node/pull/22408 Fixes: https://github.com/nodejs/node/issues/21446 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-08-14lib: remove unused filterInternalStackFrames paramMaleDong
Actually we don't refer the `error` directly in `filterInternalStackFrames`, so just remove it anyway. PR-URL: https://github.com/nodejs/node/pull/22267 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-08-03repl: support mult-line string-keyed objectsSam Ruby
isRecoverableError is completely reimplemented using acorn and an acorn plugin that examines the state of the parser at the time of the error to determine if the code could be completed on a subsequent line. PR-URL: https://github.com/nodejs/node/pull/21805 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: John-David Dalton <john.david.dalton@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-07-13repl: make own properties shadow prototype propertiesSam Ruby
Previously, the code displayed properties backwards (e.g., showing prototype properties before own properties). It also did uniqueness checks during this processing, so these checks were done backwards. After this change, the properties continue to be displayed backwards, but the uniqueness checks are done in the proper order. See also: https://github.com/nodejs/node/issues/21586 which was discovered during the testing of this fix. Fixes: https://github.com/nodejs/node/issues/15199 PR-URL: https://github.com/nodejs/node/pull/21588 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-07-02repl: fix tab completion for object properties with special charWeijia Wang
The old RegExp will pass property names like `"hello world!"` when filtering the results of tab complete. This change is to fix it. Fixes: https://github.com/nodejs/node/issues/21201 PR-URL: https://github.com/nodejs/node/pull/21556 Fixes: https://github.com/nodejs/node/issues/21201 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
2018-05-28Revert "repl: add friendly tips about how to exit repl"cjihrig
This reverts commit 9aa4ec43fce7fd9166459c98f347760cf450a350. This commit in question introduced a regression in repl.eval(), as the context argument is no longer passed to runInContext(). PR-URL: https://github.com/nodejs/node/pull/20972 Fixes: https://github.com/nodejs/node/issues/20965 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
2018-05-19repl: make console, module and require non-enumerableRuben Bridgewater
This aligns these globals with the regular context. PR-URL: https://github.com/nodejs/node/pull/20717 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-05-18repl: add friendly tips about how to exit replmonkingxue
Imitate python repl, when the user enters 'exit' or 'quit', no longer prompt 'Reference Error', but prompts 'To exit, press ^D or type .exit'. If the user defines variables named 'exit' or 'quit' , only the value of the variables are output PR-URL: https://github.com/nodejs/node/pull/20617 Fixes: https://github.com/nodejs/node/issues/19021 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-05-11Revert "util: change util.inspect depth default"Anna Henningsen
This reverts commit b994b8eff6018433a56bb10dbc473cefa0dd9370. This caused regressions in ecosystem code. While the change originally was semver-major and could be postponed until after Node.js 10, I think reverting it is a good choice at this point. Also, I personally do not think defaulting to a shallow inspect is a bad thing at all – quite the opposite: It makes `util.inspect()` give an overview of an object, rather than providing a full display of its contents. Changing the `depth` default to infinity fundamentally changed the role that `util.inspect()` plays, and makes output much more verbose and thus at times unusable for `console.log()`-style debugging. PR-URL: https://github.com/nodejs/node/pull/20017 Fixes: https://github.com/nodejs/node/issues/19405 Refs: https://github.com/nodejs/node/pull/17907 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-05-05repl: add spaces to load/save messagescjihrig
PR-URL: https://github.com/nodejs/node/pull/20536 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-04-18repl: hide top-level await feature behind a flagTimothy Gu
PR-URL: https://github.com/nodejs/node/pull/19604 Refs: https://github.com/nodejs/node/pull/17807 Refs: https://github.com/nodejs/node/pull/15566#issuecomment-353428430 Reviewed-By: Gus Caplan <me@gus.host>
2018-03-15lib: restructure cjs and esm loadersJoyee Cheung
Create `lib/internal/modules` and restructure the module loaders to make the purpose of those files clearer. Also make it clear in the code that the object exported by `lib/internal/modules/cjs/loader.js` is `CJSModule` instead of the ambiguous `Module`. Before: ``` lib ├── ... ├── internal │ ├── loaders │ │ ├── CreateDynamicModule.js │ │ ├── DefaultResolve.js │ │ ├── Loader.js │ │ ├── ModuleJob.js │ │ ├── ModuleMap.js │ │ └── Translators.js │ └── module.js └── module.js ``` After: ``` lib ├── ... ├── internal │ ├── ... │ └── modules │ ├── cjs │ │ ├── helpers.js │ │ └── loader.js │ └── esm │ ├── CreateDynamicModule.js │ ├── DefaultResolve.js │ ├── Loader.js │ ├── ModuleJob.js │ ├── ModuleMap.js │ └── Translators.js └── module.js # deleted in this commit to work with git file mode ``` PR-URL: https://github.com/nodejs/node/pull/19177 Refs: https://github.com/nodejs/node/pull/19112 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2018-03-11repl: better handling of recoverable errorsPrince J Wesley
Below syntax errors are handled without force .break/clear - Unexpected Token (prefix errors) - missing ) after argument list In the multiline expression, recoverable errors are truly recoverable, otherwise syntax error will be thrown. PR-URL: https://github.com/nodejs/node/pull/18915 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Shingo Inoue <leko.noor@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-03-11repl: remove magic modeRuben Bridgewater
The magic mode is long deprecated and works the same as the sloppy mode. Since the sloppy mode is the default, removing the magic mode should be safe. PR-URL: https://github.com/nodejs/node/pull/19187 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
2018-03-05lib: port errors to new systemMichaël Zasso
This is a first batch of updates that touches non-underscored modules in lib. PR-URL: https://github.com/nodejs/node/pull/19034 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-03-04repl: make last error available as `_error`Anna Henningsen
This is pretty useful when trying to inspect the last error caught by a REPL, and is made to be analogous to `_`, which contains the last successful completion value. PR-URL: https://github.com/nodejs/node/pull/18919 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com> Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
2018-02-22repl: fix tab-complete warningkillagu
When create a nest repl, will register `Runtime.executionContextCreated` listener to the inspector session.This patch will fix listener repeatedly register. PR-URL: https://github.com/nodejs/node/pull/18881 Fixes: https://github.com/nodejs/node/issues/18284 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-02-16lib: switch to Number.isNaNRuben Bridgewater
Number.isNaN is now as fast as `val !== val`. Switch to the more readable version. Also switch all `isNaN` to `Number.isNaN`. PR-URL: https://github.com/nodejs/node/pull/18744 Reviewed-By: Weijia Wang <starkwang@126.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-02-12Revert "repl: refactor tests to not rely on timing"Ruben Bridgewater
This reverts commit de848ac1e0483327a2ce8716c3f8567eaeacb660. The commit broke multiline repl. PR-URL: https://github.com/nodejs/node/pull/18715 Refs: https://github.com/nodejs/node/pull/17828 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-02-10repl: refactor tests to not rely on timingBradley Farias
Tests relying on synchronous timing have been migrated to use events. PR-URL: https://github.com/nodejs/node/pull/17828 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2018-01-16util: change util.inspect depth defaultRuben Bridgewater
The current default is not ideal in most use cases. Therefore it is changed to showing unlimited depth in case util.inspect is called directly. The default is kept as before for console.log and similar. Using console.dir will now show a depth of up to five and console.assert / console.trace will show a unlimited depth. PR-URL: https://github.com/nodejs/node/pull/17907 Refs: https://github.com/nodejs/node/issues/12693 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2018-01-04repl: refactor code for readabilityRuben Bridgewater
PR-URL: https://github.com/nodejs/node/pull/17919 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Weijia Wang <starkwang@126.com> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Lance Ball <lball@redhat.com>