File tree Expand file tree Collapse file tree
Tools/wasm/emscripten/web_example Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5656 integrity ="sha512-kmA5vhcxOkZI0ReiKJMGNb8/KKbgbExIlnt6aXuPtl86AgHBEi6OHHOz2wsTazBDGZKxe7fmiE+pIuZJQks4+A== "
5757 > </ script >
5858 < script type ="module ">
59+ const _magic_ctrlc_string = "__WASM_REPL_CTRLC_" + ( Date . now ( ) ) + "__" ;
5960 class WorkerManager {
6061 constructor (
6162 workerURL ,
261262 this . input = "" ;
262263 this . cursorPosition = 0 ;
263264 this . historyIndex = - 1 ;
264- this . resolveInput ( "__WASM_REPL_CTRLC__ \n") ;
265+ this . resolveInput ( _magic_ctrlc_string + " \n") ;
265266 break ;
266267 case "\x09" : // TAB
267268 this . handleTab ( ) ;
472473 this . resolveInput = ( value ) => {
473474 if (
474475 value . replace ( / \s / g, "" ) . length != 0 &&
475- value != "__WASM_REPL_CTRLC__ \n"
476+ value != _magic_ctrlc_string + " \n"
476477 ) {
477478 if ( this . historyIndex !== - 1 ) {
478479 this . historyBuffer [ this . historyIndex ] =
600601
601602def _interrupt_aware_input(prompt=''):
602603 line = builtins.input(prompt)
603- if line.strip() == '__WASM_REPL_CTRLC__' :
604+ if line.strip() == " ${ _magic_ctrlc_string } " :
604605 raise KeyboardInterrupt()
605606 return line
606607
You can’t perform that action at this time.
0 commit comments