summaryrefslogtreecommitdiff
path: root/test/parallel/test-repl-colors.js
AgeCommit message (Collapse)Author
2019-03-25repl: fix terminal default settingRuben Bridgewater
This makes sure that the described default behavior for the `terminal` option is actually always used and not only when running the REPL as standalone program. The options code is now logically combined instead of being spread out in the big REPL constructor. PR-URL: https://github.com/nodejs/node/pull/26518 Reviewed-By: Lance Ball <lball@redhat.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-07-16util: do not escape single quotes if not necessaryRuben Bridgewater
Right now util.inspect will always escape single quotes. That is not necessary though in case the string that will be escaped does not contain double quotes. In that case the string can simply be wrapped in double quotes instead. If the string contains single and double quotes and it does not contain `${` as part of the string, backticks will be used instead. That makes sure only very few strings have to escape quotes at all. Thus it increases the readability of these strings. PR-URL: https://github.com/nodejs/node/pull/21624 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2017-12-12repl: fix util.inspect() coloring regressionBen Noordhuis
The `Object.assign()` calls introduced in commit 90a4390 ("repl: show proxies as Proxy objects") mutated their first argument, causing the `{ colors: true }` option from the REPL to leak over into the global `util.inspect.defaultOptions` object. Refs: https://github.com/nodejs/node/pull/16485#issuecomment-350428638 PR-URL: https://github.com/nodejs/node/pull/17565 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>