(This is a departure from Promises/A+ spec. It's needed to support the use of promises with Shiny, especially reactivity, but also seems like it'd be useful for logging, profiling, error handling...)
There are some places in R and in Shiny especially, where it's very useful to set up changes to the environment temporarily, execute some user-provided code, and then change the environment back to its original state.
For one example, consider the capture.output
function. This won't work:
capture.output({