mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 15:42:44 +00:00 
			
		
		
		
	js: Save REPL history when exiting interpreter with exit()
				
					
				
			Previously, we only saved the REPL history when the interpreter was shutdown with a signal. This change ensures that we save the history when a user uses `exit()`.
This commit is contained in:
		
							parent
							
								
									8266e40b35
								
							
						
					
					
						commit
						76891ae45d
					
				
					 1 changed files with 1 additions and 0 deletions
				
			
		|  | @ -421,6 +421,7 @@ JS_DEFINE_NATIVE_FUNCTION(ReplObject::save_to_file) | ||||||
| 
 | 
 | ||||||
| JS_DEFINE_NATIVE_FUNCTION(ReplObject::exit_interpreter) | JS_DEFINE_NATIVE_FUNCTION(ReplObject::exit_interpreter) | ||||||
| { | { | ||||||
|  |     s_editor->save_history(s_history_path.to_deprecated_string()); | ||||||
|     if (!vm.argument_count()) |     if (!vm.argument_count()) | ||||||
|         exit(0); |         exit(0); | ||||||
|     exit(TRY(vm.argument(0).to_number(vm)).as_double()); |     exit(TRY(vm.argument(0).to_number(vm)).as_double()); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Evan Smal
						Evan Smal