@jcheng5 , that's correct. 

Had a chance to sit down and walk through some of these proposals--I think for now we should leave the code as-is, with the exception of the change that will fix R CMD check (sorry, should have ran that before submitting the PR!). 

The reason is that presently RStudio's debug registration hooks fetch the named function from the environment (or object). If the function isn't present in the environment at the time the registration handler is called, things won't work. So either `exprToFunction` or `registerShinyDebugHook` would need to gain a side effect of pushing the function into the environment (in addition to returning precisely the same function). I'm not sure we could make it do all that stuff and keep the signature backward-compatible without making the behavior, parameters, and return value difficult to understand. 

I think we should just have two different functions -- one untouched `exprToFunction` and another that takes a name, environment/object, and expression and wraps up the debug registration with a clearly document side effect of creating the named object in the given environment/object. I'll put this together and submit another PR.