summaryrefslogtreecommitdiff
path: root/test/parallel/test-repl-top-level-await.js
AgeCommit message (Collapse)Author
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-06repl: use better uncaught exceptions indicatorRuben Bridgewater
This switches "Thrown:" with "Uncaught" to outline clearer that the thrown error is not caught. PR-URL: https://github.com/nodejs/node/pull/29676 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-10-03errors: make sure all Node.js errors show their propertiesRuben Bridgewater
This improves Node.js errors by always showing the attached properties when inspecting such an error. This applies especially to SystemError. It did often not show any properties but now all properties will be visible. This is done in a mainly backwards compatible way. Instead of using prototype getters and setters, the property is now set directly on the error. PR-URL: https://github.com/nodejs/node/pull/29677 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2019-07-20lib: rename lib/internal/readline.jscjihrig
This commit moves lib/internal/readline.js to lib/internal/readline/utils.js. This is in preparation of adding a readline.promises implementation. PR-URL: https://github.com/nodejs/node/pull/28753 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
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-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-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-23test: move common.ArrayStream to separate moduleJames M Snell
In a continuing effort to de-monolithize `require('../common')`, move `common.ArrayStream` out to a separate module that is imported only when it is needed. PR-URL: https://github.com/nodejs/node/pull/22447 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-07-19test: make crashOnUnhandleRejection opt-outMichaël Zasso
This commit removes `common.crashOnUnhandledRejection()` and adds `common.disableCrashOnUnhandledRejection()`. To reduce the risk of mistakes and make writing tests that involve promises simpler, always install the unhandledRejection hook in tests and provide a way to disable it for the rare cases where it's needed. PR-URL: https://github.com/nodejs/node/pull/21849 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-04-25src: assign ERR_SCRIPT_EXECUTION_* codes in C++Joyee Cheung
Also modifies the error messages so they include more information and are more consistent. - The message of ERR_SCRIPT_EXECUTION_INTERRUPTED now mentions SIGINT and the trailing period is dropped for consistency. - Added ERR_SCRIPT_EXECUTION_TIMEOUT and include the timeout in the message. PR-URL: https://github.com/nodejs/node/pull/20147 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
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>
2017-12-22repl: migrate errors to internal/errorskysnm
PR-URL: https://github.com/nodejs/node/pull/17716 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-12-04test: move common.fires() to inspector-helperRich Trott
common.fires() is specific to the inspector tests so move it to inspector-helper.js. The one REPL test that used common.fires() does not seem to need it. It provided a 1 second timeout for operations, but that timeout appears both arbitrary and ineffective as the test passes if it is reduced to even 1 millisecond. PR-URL: https://github.com/nodejs/node/pull/17401 Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@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>