mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
Fix bug in REPL where history file was closed late.
The history file was set to close on process exit, when it should close on REPL exit. Listening to the process exit event causes a warning when more than 10 CoffeeScript REPL instances are opened in the same program, which happens in the test.
This commit is contained in:
@@ -118,8 +118,8 @@
|
||||
return lastLine = code;
|
||||
}
|
||||
});
|
||||
process.on('exit', function() {
|
||||
return fs.closeSync(fd);
|
||||
repl.rli.on('exit', function() {
|
||||
return fs.close(fd);
|
||||
});
|
||||
return repl.commands['.history'] = {
|
||||
help: 'Show command history',
|
||||
|
||||
@@ -108,8 +108,7 @@ addHistory = (repl, filename, maxSize) ->
|
||||
fs.write fd, "#{code}\n"
|
||||
lastLine = code
|
||||
|
||||
process.on 'exit', ->
|
||||
fs.closeSync fd
|
||||
repl.rli.on 'exit', -> fs.close fd
|
||||
|
||||
# Add a command to show the history stack
|
||||
repl.commands['.history'] =
|
||||
|
||||
Reference in New Issue
Block a user