@@ -452,8 +452,8 @@ evalFuture <- function(
452452 if (length(globals ) > 0 ) {
453453 # # Preserve globals in all environments until the global environment
454454 names <- names(globals )
455- envs <- list ()
456- oldEnvs <- list ()
455+ currEnvs <- list ()
456+ pastEnvs <- list ()
457457 env <- globalenv()
458458 repeat {
459459 if (identical(env , emptyenv())) break
@@ -473,8 +473,8 @@ evalFuture <- function(
473473 }, error = identity )
474474 }
475475 }
476- envs <- c(envs , env )
477- oldEnvs <- c(oldEnvs , oldEnv )
476+ currEnvs <- c(currEnvs , env )
477+ pastEnvs <- c(pastEnvs , oldEnv )
478478 if (identical(env , globalenv())) break
479479 env <- parent.env(env )
480480 }
@@ -483,9 +483,9 @@ evalFuture <- function(
483483 # # Remove globals from the global environment
484484 rm(list = names(globals ), envir = genv , inherits = FALSE )
485485 # # Restore objects in all modified environments
486- for (ee in seq_along(envs )) {
487- oldEnv <- oldEnvs [[ee ]]
488- env <- envs [[ee ]]
486+ for (ee in seq_along(currEnvs )) {
487+ oldEnv <- pastEnvs [[ee ]]
488+ env <- currEnvs [[ee ]]
489489 for (name in names(oldEnv )) {
490490 value <- get(name , envir = oldEnv , inherits = FALSE )
491491 assign(name , value = value , envir = env , inherits = FALSE )
0 commit comments