Last active
October 18, 2016 01:36
-
-
Save brodieG/3732f747940fbb9c547e330b8610bf39 to your computer and use it in GitHub Desktop.
Browser Bugs With on.exit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Tested on OS X and Ubuntu R 3.3.1, appears fixed in R-devel | |
# WARNING: you may have to kill your session if you run the code here | |
fun <- function() { | |
on.exit(cat('exited\n')) | |
stop('hello') | |
} | |
{ | |
browser() | |
# type `fun()` at Browser[1]> prompt to cause infinite loop | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Somehow looks like the
on.exit
call causes R to lose track of context and results in theabort
restart re-evaluatingfun
, but only when inbrowser()
context as well.