Skip to content

Commit 7bdb606

Browse files
evalFuture(): Name local() environment 'future:evalenv'
1 parent 15191ea commit 7bdb606

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

R/expressions.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,12 @@ evalFuture <- function(
314314
## -----------------------------------------------------------------
315315
## Evaluate expression in a local() environment?
316316
if (local) {
317-
tmpl_expr_local <- bquote_compile(base::local(.(expr)))
317+
tmpl_expr_local <- bquote_compile(base::local({
318+
env <- base::environment()
319+
base::attr(env, "name") <- "future:evalenv"
320+
base::rm(list = "env")
321+
.(expr)
322+
}))
318323
expr <- bquote_apply(tmpl_expr_local)
319324
## WORKAROUND: This makes assumption about withCallingHandlers()
320325
## and local(). In case this changes, provide internal options to

0 commit comments

Comments
 (0)