Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-05-31lib: improve debuglog() performanceBrian White
PR-URL: https://github.com/nodejs/node/pull/32260 Reviewed-By: James M Snell <jasnell@gmail.com>
2020-05-15repl: show reference errors during previewRuben Bridgewater
This aligns the behavior with the one in the Firefox console. It will visualize ReferenceErrors in case the input has no possible completion and no buffered input. That way typos can already be highlighted before being evaluated. Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: https://github.com/nodejs/node/pull/33282 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2020-05-15repl: improve repl previewRuben Bridgewater
This aligns the REPL preview with the one used in the Chrome DevTools console. It will now preview the output for the input including the completion suffix as input. When pressing enter while previewing such data, it will automatically insert the suffix before evaluating the input. When pressing escape, that behavior is deactivated until the input is changed. Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: https://github.com/nodejs/node/pull/33282 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2020-03-13repl: align preview with the actual executed codeRuben Bridgewater
This adds preview output for input that may not be wrapped. PR-URL: https://github.com/nodejs/node/pull/32154 Reviewed-By: Shelley Vohr <codebytere@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2020-01-22util: improve unicode supportRuben Bridgewater
The array grouping function relies on the width of the characters. It was not calculated correct so far, since it used the string length instead. This improves the unicode output by calculating the mono-spaced font width (other fonts might differ). PR-URL: https://github.com/nodejs/node/pull/31319 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Steven R Loomis <srloomis@us.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
2020-01-13repl: do not preview while pasting codeRuben Bridgewater
This makes sure no previews are triggered while pasting code. The very last character is allowed to trigger the preview. The output should be completely identical to the user. PR-URL: https://github.com/nodejs/node/pull/31315 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
2020-01-12repl: fix preview cursor positionRuben Bridgewater
The cusor position was off in case the preview was exactly as long as the current terminal was wide. PR-URL: https://github.com/nodejs/node/pull/31293 Fixes: https://github.com/nodejs/node/issues/31291 Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-12repl,readline: clean up codeRuben Bridgewater
This simplifies code that was more complicated than it had to be and removes code that should never be reached. PR-URL: https://github.com/nodejs/node/pull/31288 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-10test: add repl tests to verify unicode support in previewsRuben Bridgewater
This also adds a test to verify that changed writer options also change the preview output depending on the options. PR-URL: https://github.com/nodejs/node/pull/31112 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2020-01-10repl: activate previews for lines exceeding the terminal columnsRuben Bridgewater
This improves the completion previews by activating them for lines that exceed the current terminal columns. As a drive-by fix it also simplifies some statements. PR-URL: https://github.com/nodejs/node/pull/31112 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2020-01-10readline,repl: add substring based history searchRuben Bridgewater
This improves the current history search feature by adding substring based history search similar to ZSH. In case the `UP` or `DOWN` buttons are pressed after writing a few characters, the start string up to the current cursor is used to search the history. All other history features work exactly as they used to. PR-URL: https://github.com/nodejs/node/pull/31112 Fixes: https://github.com/nodejs/node/issues/28437 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2020-01-10repl: improve preview length calculationRuben Bridgewater
The preview had an off by one error in case colors where deactivated and did not take fullwidth unicode characters into account when displaying the preview. PR-URL: https://github.com/nodejs/node/pull/31112 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2020-01-04lib: replace Set global by the primordialsSebastien Ahkrin
PR-URL: https://github.com/nodejs/node/pull/31154 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2019-12-26repl: use public getCursorPos()cjihrig
_getCursorPos() recently became public API. This commit updates the remaining uses of _getCursorPos() to use the public API. PR-URL: https://github.com/nodejs/node/pull/31091 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-12-25repl: implement reverse searchRuben Bridgewater
Add a reverse search that works similar to the ZSH one. It is triggered with <ctrl> + r and <ctrl> + s. It skips duplicated history entries and works with multiline statements. Matching entries indicate the search parameter with an underscore and cancelling with <ctrl> + c or escape brings back the original line. Multiple matches in a single history entry work as well and are matched in the order of the current search direction. The cursor is positioned at the current match position of the history entry. Changing the direction immediately checks for the next entry in the expected direction from the current position on. Entries are accepted as soon any button is pressed that doesn't correspond with the reverse search. The behavior is deactivated for simple terminals. They do not support most ANSI escape codes that are necessary for this feature. PR-URL: https://github.com/nodejs/node/pull/31006 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-12-25repl: fix preview of lines that exceed the terminal columnsRuben Bridgewater
This adds support for very long input lines to still display the input preview correct. PR-URL: https://github.com/nodejs/node/pull/31006 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-12-15repl: fix preview bug in case of long linesRuben Bridgewater
This addresses an issue that is caused by lines that exceed the current window columns. That would cause the preview to confuse the REPL. This is meant as hot fix. The preview should be able to handle these cases appropriately as well later on. PR-URL: https://github.com/nodejs/node/pull/30907 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-12-15repl: add completion previewRuben Bridgewater
This improves the already existing preview functionality by also checking for the input completion. In case there's only a single completion, it will automatically be visible to the user in grey. If colors are deactivated, it will be visible as comment. This also changes some keys by automatically accepting the preview by moving the cursor behind the current input end. PR-URL: https://github.com/nodejs/node/pull/30907 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-12-10repl: support previews by eager evaluating inputRuben Bridgewater
This adds input previews by using the inspectors eager evaluation functionality. It is implemented as additional line that is not counted towards the actual input. In case no colors are supported, it will be visible as comment. Otherwise it's grey. It will be triggered on any line change. It is heavily tested against edge cases and adheres to "dumb" terminals (previews are deactived in that case). PR-URL: https://github.com/nodejs/node/pull/30811 Fixes: https://github.com/nodejs/node/issues/20977 Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2019-12-08lib: replace Symbol global by the primordials SymbolSebastien Ahkrin
PR-URL: https://github.com/nodejs/node/pull/30737 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-11-30lib: enforce use of Boolean from primordialsMichaël Zasso
Refs: https://github.com/nodejs/node/issues/30697 PR-URL: https://github.com/nodejs/node/pull/30698 Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
2019-11-25lib: flatten access to primordialsMichaël Zasso
Store all primordials as properties of the primordials object. Static functions are prefixed by the constructor's name and prototype methods are prefixed by the constructor's name followed by "Prototype". For example: primordials.Object.keys becomes primordials.ObjectKeys. PR-URL: https://github.com/nodejs/node/pull/30610 Refs: https://github.com/nodejs/node/issues/29766 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2019-11-25lib: changed var to letOliver Belaifa
PR-URL: https://github.com/nodejs/node/pull/30427 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2019-11-23repl: change var to letOliver Belaifa
PR-URL: https://github.com/nodejs/node/pull/30428 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2019-08-11repl: close file descriptor of history fileJoão Reis
PR-URL: https://github.com/nodejs/node/pull/28858 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-07-15deps: update acorn to 6.2.0Michaël Zasso
Includes support for bigint syntax so we can remove the acorn-bigint plugin. PR-URL: https://github.com/nodejs/node/pull/28649 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
2019-04-30repl: handle stage-3 language features properlyRuben Bridgewater
This adds stage-3 language features to acorn so that the REPL is able to parse these features properly. Otherwise these would cause SyntaxErrors. PR-URL: https://github.com/nodejs/node/pull/27400 Fixes: https://github.com/nodejs/node/issues/27391 Fixes: https://github.com/nodejs/node/issues/25835 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2019-04-30repl: add new language features to top level await statementsRuben Bridgewater
This adds stage-3 language features to acorn so that it's possible to parse these features when using top level await in the REPL. PR-URL: https://github.com/nodejs/node/pull/27400 Refs: https://github.com/nodejs/node/issues/27391 Refs: https://github.com/nodejs/node/issues/25835 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2019-04-15lib: require globals instead of using the global proxyJoyee Cheung
In addition, use process.stderr instead of console.error when there is no need to swallow the error. PR-URL: https://github.com/nodejs/node/pull/27112 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-04-12lib: enforce the use of Object from primordialsMichaël Zasso
PR-URL: https://github.com/nodejs/node/pull/27146 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
2019-03-22repl: remove usage of require('util') in `repl/history`dnlup
Use `require('internal/util/debuglog').debuglog` instead of `require('util').debuglog`. Refs: https://github.com/nodejs/node/issues/26546 PR-URL: https://github.com/nodejs/node/pull/26819 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-03-08repl: add replDefaults to customize the writerRuben Bridgewater
So far it was not possible to modify the inspection defaults used by the REPL from the running instance itself. This introduces a new property on `util.inspect` which is only used inside the REPL and which allows to modify the used inspection defaults at any point of time. PR-URL: https://github.com/nodejs/node/pull/26375 Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-13lib: fix the typo errorMaleDong
Fix a typo error ('the' before 'any'). PR-URL: https://github.com/nodejs/node/pull/26032 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Lance Ball <lball@redhat.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
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>
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>
2018-10-28repl: support top-level for-await-ofShelley Vohr
PR-URL: https://github.com/nodejs/node/pull/23841 Fixes: https://github.com/nodejs/node/issues/23836 Reviewed-By: John-David Dalton <john.david.dalton@gmail.com> Reviewed-By: Yuta Hiroto <hello@hiroppy.me> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Matheus Marchini <mat@mmarchini.me> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-10-13repl: remove unused variable from try catchmmisiarek
Catch statement defines err variable that is never used, so it is safe to remove that. PR-URL: https://github.com/nodejs/node/pull/23452 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@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-08-27deps: import acorn@5.7.2Sam Ruby
Imported from the tarball published on npm (https://registry.npmjs.org/acorn/-/acorn-5.7.2.tgz). Update to emcaScript version 10 in order to get support for binding-less catch statements. Also needed to parse node.js lib API in #22405. PR-URL: https://github.com/nodejs/node/pull/22488 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: John-David Dalton <john.david.dalton@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Bryan English <bryan@bryanenglish.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-08-04repl: 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>
2017-11-17repl: support top-level awaitTimothy Gu
Much of the AST visitor code was ported from Chrome DevTools code written by Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>. PR-URL: https://github.com/nodejs/node/pull/15566 Fixes: https://github.com/nodejs/node/issues/13209 Refs: https://chromium.googlesource.com/chromium/src/+/e8111c396fef38da6654093433b4be93bed01dce Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>