Skip to content

Commit

Permalink
make sure function can be found (in baseenv())
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed Apr 29, 2024
1 parent 15d5447 commit abd2472
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/cache.R
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ find_globals = function(code, envir = parent.frame()) {
fun = function() {}
body(fun) = code
} else {
fun = eval(parse_only(c('function(){', code, '}')), envir)
fun = eval(parse_only(c('function(){', code, '}')), baseenv())
}
obj = codetools::findGlobals(fun)
intersect(obj, ls_all(envir, TRUE))
Expand Down

0 comments on commit abd2472

Please sign in to comment.