Ruben Bridgewater
edde065191
repl: indicate if errors are thrown or not
...
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 >
2019-01-02 14:58:47 +01:00
Ruben Bridgewater
4b7a530f2b
lib: switch to object spread where possible
...
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-20 13:14:46 +01:00
Ruben Bridgewater
50dd555910
doc,lib,test: capitalize comment sentences
...
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-17 17:14:35 +01:00
Ruben Bridgewater
b1ada6c9de
Revert "lib: repl multiline history support"
...
This reverts commit dd7a3d246d .
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-05 23:36:10 -08:00
Ruben Bridgewater
fd2467aeaa
Revert "repl: handle buffered string logic on finish"
...
This reverts commit eb42c1eb4f .
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-05 23:36:06 -08:00
Ruben Bridgewater
59257543c3
lib: use ES6 class inheritance style
...
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-05 16:55:00 +01:00
Ruben Bridgewater
dcc82b37b6
lib: remove inherits() usage
...
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-12-05 16:53:58 +01:00
Anto Aravinth
eb42c1eb4f
repl: handle buffered string logic on finish
...
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-19 10:47:41 -08:00
Gus Caplan
7082c61e27
Revert "util: change util.inspect depth default"
...
This reverts commit ac7450a09a .
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-14 19:44:39 -08:00
Joyee Cheung
f895b5a58e
src: cache the result of GetOptions() in JS land
...
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-07 20:40:38 -08:00
cjihrig
a7ba5faaf5
repl: remove unused catch bindings
...
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-06 10:59:13 -05:00
MaleDong
9a20a12830
lib:fix grammar error and make it clearer for comments
...
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-05 21:58:20 -08:00
Weijia Wang
c1e670338b
repl: use promise#finally
...
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-03 19:40:18 -07:00
Anto Aravinth
dd7a3d246d
lib: repl multiline history support
...
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-11-02 13:56:33 -07:00
Jose Bucio
f1b95467dc
repl: migrate from process.binding('config') to getOptions()
...
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-22 14:57:20 -07:00
Khalid Adil
f0c5c962ce
repl: remove unused variable e from try catch
...
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-13 09:08:12 -07:00
Gus Caplan
e7f710c1d4
bootstrapper: move internalBinding to NativeModule
...
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-04 11:55:34 +02:00
Ruben Bridgewater
ac7450a09a
util: change util.inspect depth default
...
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-02 22:43:09 +02:00
Rich Trott
83d0404971
repl: do not swallow errors in nested REPLs
...
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-10-02 13:07:18 -07:00
cjihrig
2bf4697ff4
repl: remove duplicate util binding
...
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-05 21:53:43 -04:00
cjihrig
7e4b0a4850
util: make util binding internal
...
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-09-05 21:53:11 -04:00
Ruben Bridgewater
2eef077834
repl: refactor ERR_SCRIPT_EXECUTION_INTERRUPTED stack handling
...
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-27 14:08:44 +02:00
Ruben Bridgewater
ccb303e037
repl: improve error output
...
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-27 14:08:43 +02:00
Ruben Bridgewater
68b07ded9c
repl: tab auto complete big arrays
...
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-23 00:10:52 +02:00
MaleDong
801814686d
lib: remove unused filterInternalStackFrames param
...
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-14 11:52:46 -04:00
Sam Ruby
a2ec80851c
repl: support mult-line string-keyed objects
...
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-08-03 20:20:00 -07:00
Sam Ruby
4d42083d1a
repl: make own properties shadow prototype properties
...
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-13 18:57:16 +02:00
Weijia Wang
4f15122847
repl: fix tab completion for object properties with special char
...
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-07-02 23:04:04 +08:00
cjihrig
4dbfb096f0
Revert "repl: add friendly tips about how to exit repl"
...
This reverts commit 9aa4ec43fc .
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-28 13:53:26 -04:00
Ruben Bridgewater
f954aba39e
repl: make console, module and require non-enumerable
...
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-19 17:55:55 +02:00
monkingxue
9aa4ec43fc
repl: add friendly tips about how to exit repl
...
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-18 15:47:17 +02:00
Anna Henningsen
849aaaeeb0
Revert "util: change util.inspect depth default"
...
This reverts commit b994b8eff6 .
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-11 17:46:56 +02:00
cjihrig
17a4421b69
repl: add spaces to load/save messages
...
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-05-05 13:39:11 +02:00
Timothy Gu
be92eab92a
repl: hide top-level await feature behind a flag
...
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-04-18 07:50:17 -07:00
Joyee Cheung
c2b01881dc
lib: restructure cjs and esm loaders
...
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-15 20:50:35 +08:00
Prince J Wesley
ebfa8b1464
repl: better handling of recoverable errors
...
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-11 03:28:18 +01:00
Ruben Bridgewater
4893f70d12
repl: remove magic mode
...
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-11 02:43:27 +01:00
Michaël Zasso
1e8d110e64
lib: port errors to new system
...
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-05 19:51:30 +01:00
Anna Henningsen
a8b5192fef
repl: make last error available as _error
...
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-03-04 22:01:57 +00:00
killagu
26231548ad
repl: fix tab-complete warning
...
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-22 15:07:05 +00:00
Ruben Bridgewater
96c57fbfaa
lib: switch to Number.isNaN
...
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-16 18:09:56 +01:00
Ruben Bridgewater
1fc373bdf6
Revert "repl: refactor tests to not rely on timing"
...
This reverts commit de848ac1e0 .
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-12 15:42:06 +01:00
Bradley Farias
de848ac1e0
repl: refactor tests to not rely on timing
...
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-02-10 14:19:54 +01:00
Ruben Bridgewater
b994b8eff6
util: change util.inspect depth default
...
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-16 15:34:03 +01:00
Ruben Bridgewater
11dda69a33
repl: refactor code for readability
...
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 >
2018-01-04 21:21:22 +01:00
Ruben Bridgewater
80988f9322
repl: upper case comments first char
...
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 >
2018-01-04 21:21:21 +01:00
kysnm
ab5a2aba38
repl: migrate errors to internal/errors
...
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-22 13:27:25 -05:00
Michaël Zasso
416c0ec952
repl: show lexically scoped vars in tab completion
...
Use the V8 inspector protocol, if available, to query the list of
lexically scoped variables (defined with `let`, `const` or `class`).
PR-URL: https://github.com/nodejs/node/pull/16591
Fixes: https://github.com/nodejs/node/issues/983
Reviewed-By: Timothy Gu <timothygu99@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2017-12-21 14:47:29 +01:00
Ben Noordhuis
727339e9c2
repl: fix util.inspect() coloring regression
...
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 >
2017-12-12 12:49:32 -02:00
Timothy Gu
eeab7bc068
repl: support top-level await
...
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 >
2017-11-16 15:42:46 -08:00