This repository was archived by the owner on Feb 1, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -192,7 +192,7 @@ function aliasProperties(target, mapping) {
192192}
193193
194194function createRepl ( inspector ) {
195- const { Debugger } = inspector ;
195+ const { Debugger, Runtime } = inspector ;
196196
197197 let repl ; // eslint-disable-line prefer-const
198198 let lastCommand ;
@@ -583,6 +583,16 @@ function createRepl(inspector) {
583583 watchedExpressions . splice ( index !== - 1 ? index : + expr , 1 ) ;
584584 } ,
585585
586+ get version ( ) {
587+ return Runtime . evaluate ( {
588+ expression : 'process.versions.v8' ,
589+ contextId : 1 ,
590+ returnByValue : true ,
591+ } ) . then ( ( { result } ) => {
592+ print ( result . value ) ;
593+ } ) ;
594+ } ,
595+
586596 scripts : listScripts ,
587597 setBreakpoint,
588598 clearBreakpoint,
Original file line number Diff line number Diff line change @@ -18,6 +18,10 @@ test('examples/empty.js', (t) => {
1818 . then ( ( ) => {
1919 t . match ( cli . output , 'hello world' , 'repeats the last command on <enter>' ) ;
2020 } )
21+ . then ( ( ) => cli . command ( 'version' ) )
22+ . then ( ( ) => {
23+ t . match ( cli . output , process . versions . v8 , 'version prints the v8 version' ) ;
24+ } )
2125 . then ( ( ) => cli . quit ( ) )
2226 . then ( ( code ) => {
2327 t . equal ( code , 0 , 'exits with success' ) ;
You can’t perform that action at this time.
0 commit comments