Skip to content

Commit

Permalink
Improve variable names (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley authored Jul 15, 2024
1 parent 7afb325 commit 23f6656
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion R/conditions.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ sanitize_call <- function(cnd) {
if (identical(cnd$call, quote(withVisible(do)))) {
cnd$call <- NULL
}
if (identical(cnd$call, quote(eval(as.call(list(cb)), envir)))) {
if (identical(cnd$call, quote(eval(as.call(list(context)), envir)))) {
cnd$call <- NULL
}

Expand Down
7 changes: 3 additions & 4 deletions R/evaluate.R
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ evaluate <- function(input,
envir <- list2env(envir, parent = enclos %||% parent.frame())
}
local_inject_funs(envir)



# Handlers for warnings, errors and messages
user_handlers <- output_handler$calling_handlers
evaluate_handlers <- condition_handlers(
Expand All @@ -134,7 +133,7 @@ evaluate <- function(input,
# The user's condition handlers have priority over ours
handlers <- c(user_handlers, evaluate_handlers)

cb <- function() {
context <- function() {
do <- NULL # silence R CMD check note

for (tle in tles) {
Expand Down Expand Up @@ -174,7 +173,7 @@ evaluate <- function(input,

# Here we use `eval()` to create an unwinding scope for `envir`.
# We call ourselves back immediately once the scope is created.
eval(as.call(list(cb)), envir)
eval(as.call(list(context)), envir)
watcher$capture_output()

# Always capture last plot, even if incomplete
Expand Down

0 comments on commit 23f6656

Please sign in to comment.