summaryrefslogtreecommitdiff
path: root/lib/internal/repl
AgeCommit message (Collapse)Author
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-22repl: 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-10repl: 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-16lib: 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-23repl: 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-26deps: 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-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>
2017-11-16repl: 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>