1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05: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:
Robert Martin 2013-04-20 14:49:54 -04:00
parent 4b4818d819
commit 71aea4b862
2 changed files with 3 additions and 4 deletions

View file

@ -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',

View file

@ -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'] =