@@ -376,7 +376,7 @@ <h1>repl.coffee</h1>
376
376
vm.runInContext js, context, filename
377
377
< span class ="hljs-function ">
378
378
< span class ="hljs-title "> addMultilineHandler</ span > = < span class ="hljs-params "> (repl)</ span > -></ span >
379
- {rli, inputStream, outputStream} = repl</ pre > </ div > </ div >
379
+ {inputStream, outputStream} = repl</ pre > </ div > </ div >
380
380
381
381
</ li >
382
382
@@ -412,15 +412,15 @@ <h1>repl.coffee</h1>
412
412
413
413
</ div >
414
414
415
- < div class ="content "> < div class ='highlight '> < pre > nodeLineListener = rli .listeners(< span class ="hljs-string "> 'line'</ span > )[< span class ="hljs-number "> 0</ span > ]
416
- rli .removeListener < span class ="hljs-string "> 'line'</ span > , nodeLineListener
417
- rli .< span class ="hljs-literal "> on</ span > < span class ="hljs-string "> 'line'</ span > , < span class ="hljs-function "> < span class ="hljs-params "> (cmd)</ span > -></ span >
415
+ < div class ="content "> < div class ='highlight '> < pre > nodeLineListener = repl .listeners(< span class ="hljs-string "> 'line'</ span > )[< span class ="hljs-number "> 0</ span > ]
416
+ repl .removeListener < span class ="hljs-string "> 'line'</ span > , nodeLineListener
417
+ repl .< span class ="hljs-literal "> on</ span > < span class ="hljs-string "> 'line'</ span > , < span class ="hljs-function "> < span class ="hljs-params "> (cmd)</ span > -></ span >
418
418
< span class ="hljs-keyword "> if</ span > multiline.enabled
419
419
multiline.buffer += < span class ="hljs-string "> "< span class ="hljs-subst "> #{cmd}</ span > \n"</ span >
420
- rli .setPrompt multiline.prompt
421
- rli .prompt < span class ="hljs-literal "> true</ span >
420
+ repl .setPrompt multiline.prompt
421
+ repl .prompt < span class ="hljs-literal "> true</ span >
422
422
< span class ="hljs-keyword "> else</ span >
423
- rli .setPrompt origPrompt
423
+ repl .setPrompt origPrompt
424
424
nodeLineListener cmd
425
425
< span class ="hljs-keyword "> return</ span > </ pre > </ div > </ div >
426
426
@@ -456,8 +456,8 @@ <h1>repl.coffee</h1>
456
456
457
457
< div class ="content "> < div class ='highlight '> < pre > < span class ="hljs-keyword "> unless</ span > multiline.buffer.match < span class ="hljs-regexp "> /\n/</ span >
458
458
multiline.enabled = < span class ="hljs-keyword "> not</ span > multiline.enabled
459
- rli .setPrompt origPrompt
460
- rli .prompt < span class ="hljs-literal "> true</ span >
459
+ repl .setPrompt origPrompt
460
+ repl .prompt < span class ="hljs-literal "> true</ span >
461
461
< span class ="hljs-keyword "> return</ span > </ pre > </ div > </ div >
462
462
463
463
</ li >
@@ -473,7 +473,7 @@ <h1>repl.coffee</h1>
473
473
474
474
</ div >
475
475
476
- < div class ="content "> < div class ='highlight '> < pre > < span class ="hljs-keyword "> return</ span > < span class ="hljs-keyword "> if</ span > rli .line? < span class ="hljs-keyword "> and</ span > < span class ="hljs-keyword "> not</ span > rli .line.match < span class ="hljs-regexp "> /^\s*$/</ span > </ pre > </ div > </ div >
476
+ < div class ="content "> < div class ='highlight '> < pre > < span class ="hljs-keyword "> return</ span > < span class ="hljs-keyword "> if</ span > repl .line? < span class ="hljs-keyword "> and</ span > < span class ="hljs-keyword "> not</ span > repl .line.match < span class ="hljs-regexp "> /^\s*$/</ span > </ pre > </ div > </ div >
477
477
478
478
</ li >
479
479
@@ -489,10 +489,10 @@ <h1>repl.coffee</h1>
489
489
</ div >
490
490
491
491
< div class ="content "> < div class ='highlight '> < pre > multiline.enabled = < span class ="hljs-keyword "> not</ span > multiline.enabled
492
- rli .line = < span class ="hljs-string "> ''</ span >
493
- rli .cursor = < span class ="hljs-number "> 0</ span >
494
- rli .output.cursorTo < span class ="hljs-number "> 0</ span >
495
- rli .output.clearLine < span class ="hljs-number "> 1</ span > </ pre > </ div > </ div >
492
+ repl .line = < span class ="hljs-string "> ''</ span >
493
+ repl .cursor = < span class ="hljs-number "> 0</ span >
494
+ repl .output.cursorTo < span class ="hljs-number "> 0</ span >
495
+ repl .output.clearLine < span class ="hljs-number "> 1</ span > </ pre > </ div > </ div >
496
496
497
497
</ li >
498
498
@@ -508,12 +508,12 @@ <h1>repl.coffee</h1>
508
508
</ div >
509
509
510
510
< div class ="content "> < div class ='highlight '> < pre > multiline.buffer = multiline.buffer.replace < span class ="hljs-regexp "> /\n/g</ span > , < span class ="hljs-string "> '\uFF00'</ span >
511
- rli .emit < span class ="hljs-string "> 'line'</ span > , multiline.buffer
511
+ repl .emit < span class ="hljs-string "> 'line'</ span > , multiline.buffer
512
512
multiline.buffer = < span class ="hljs-string "> ''</ span >
513
513
< span class ="hljs-keyword "> else</ span >
514
514
multiline.enabled = < span class ="hljs-keyword "> not</ span > multiline.enabled
515
- rli .setPrompt multiline.initialPrompt
516
- rli .prompt < span class ="hljs-literal "> true</ span >
515
+ repl .setPrompt multiline.initialPrompt
516
+ repl .prompt < span class ="hljs-literal "> true</ span >
517
517
< span class ="hljs-keyword "> return</ span > </ pre > </ div > </ div >
518
518
519
519
</ li >
@@ -580,7 +580,7 @@ <h1>repl.coffee</h1>
580
580
581
581
</ div >
582
582
583
- < div class ="content "> < div class ='highlight '> < pre > repl.rli. history = buffer.toString().split(< span class ="hljs-string "> '\n'</ span > ).reverse()</ pre > </ div > </ div >
583
+ < div class ="content "> < div class ='highlight '> < pre > repl.history = buffer.toString().split(< span class ="hljs-string "> '\n'</ span > ).reverse()</ pre > </ div > </ div >
584
584
585
585
</ li >
586
586
@@ -595,7 +595,7 @@ <h1>repl.coffee</h1>
595
595
596
596
</ div >
597
597
598
- < div class ="content "> < div class ='highlight '> < pre > repl.rli. history.pop() < span class ="hljs-keyword "> if</ span > stat.size > maxSize</ pre > </ div > </ div >
598
+ < div class ="content "> < div class ='highlight '> < pre > repl.history.pop() < span class ="hljs-keyword "> if</ span > stat.size > maxSize</ pre > </ div > </ div >
599
599
600
600
</ li >
601
601
@@ -610,13 +610,13 @@ <h1>repl.coffee</h1>
610
610
611
611
</ div >
612
612
613
- < div class ="content "> < div class ='highlight '> < pre > repl.rli. history.shift() < span class ="hljs-keyword "> if</ span > repl.rli .history[< span class ="hljs-number "> 0</ span > ] < span class ="hljs-keyword "> is</ span > < span class ="hljs-string "> ''</ span >
614
- repl.rli. historyIndex = < span class ="hljs-number "> -1</ span >
615
- lastLine = repl.rli. history[< span class ="hljs-number "> 0</ span > ]
613
+ < div class ="content "> < div class ='highlight '> < pre > repl.history.shift() < span class ="hljs-keyword "> if</ span > repl.history[< span class ="hljs-number "> 0</ span > ] < span class ="hljs-keyword "> is</ span > < span class ="hljs-string "> ''</ span >
614
+ repl.historyIndex = < span class ="hljs-number "> -1</ span >
615
+ lastLine = repl.history[< span class ="hljs-number "> 0</ span > ]
616
616
617
617
fd = fs.openSync filename, < span class ="hljs-string "> 'a'</ span >
618
618
619
- repl.rli. addListener < span class ="hljs-string "> 'line'</ span > , < span class ="hljs-function "> < span class ="hljs-params "> (code)</ span > -></ span >
619
+ repl.addListener < span class ="hljs-string "> 'line'</ span > , < span class ="hljs-function "> < span class ="hljs-params "> (code)</ span > -></ span >
620
620
< span class ="hljs-keyword "> if</ span > code < span class ="hljs-keyword "> and</ span > code.length < span class ="hljs-keyword "> and</ span > code < span class ="hljs-keyword "> isnt</ span > < span class ="hljs-string "> '.history'</ span > < span class ="hljs-keyword "> and</ span > code < span class ="hljs-keyword "> isnt</ span > < span class ="hljs-string "> '.exit'</ span > < span class ="hljs-keyword "> and</ span > lastLine < span class ="hljs-keyword "> isnt</ span > code</ pre > </ div > </ div >
621
621
622
622
</ li >
@@ -667,7 +667,7 @@ <h1>repl.coffee</h1>
667
667
< div class ="content "> < div class ='highlight '> < pre > repl.commands[getCommandId(repl, < span class ="hljs-string "> 'history'</ span > )] =
668
668
help: < span class ="hljs-string "> 'Show command history'</ span >
669
669
action: < span class ="hljs-function "> -></ span >
670
- repl.outputStream.write < span class ="hljs-string "> "< span class ="hljs-subst "> #{repl.rli. history[..].reverse().join < span class ="hljs-string "> '\n'</ span > }</ span > \n"</ span >
670
+ repl.outputStream.write < span class ="hljs-string "> "< span class ="hljs-subst "> #{repl.history[..].reverse().join < span class ="hljs-string "> '\n'</ span > }</ span > \n"</ span >
671
671
repl.displayPrompt()
672
672
< span class ="hljs-function ">
673
673
< span class ="hljs-title "> getCommandId</ span > = < span class ="hljs-params "> (repl, commandName)</ span > -></ span > </ pre > </ div > </ div >
@@ -742,7 +742,7 @@ <h1>repl.coffee</h1>
742
742
opts = merge replDefaults, opts
743
743
repl = nodeREPL.start opts
744
744
runInContext opts.prelude, repl.context, < span class ="hljs-string "> 'prelude'</ span > < span class ="hljs-keyword "> if</ span > opts.prelude
745
- repl.< span class ="hljs-literal "> on</ span > < span class ="hljs-string "> 'exit'</ span > , < span class ="hljs-function "> -></ span > repl.outputStream.write < span class ="hljs-string "> '\n'</ span > < span class ="hljs-keyword "> if</ span > < span class ="hljs-keyword "> not</ span > repl.rli. closed
745
+ repl.< span class ="hljs-literal "> on</ span > < span class ="hljs-string "> 'exit'</ span > , < span class ="hljs-function "> -></ span > repl.outputStream.write < span class ="hljs-string "> '\n'</ span > < span class ="hljs-keyword "> if</ span > < span class ="hljs-keyword "> not</ span > repl.closed
746
746
addMultilineHandler repl
747
747
addHistory repl, opts.historyFile, opts.historyMaxInputSize < span class ="hljs-keyword "> if</ span > opts.historyFile</ pre > </ div > </ div >
748
748
0 commit comments