Skip to content

Commit

Permalink
Recurse over explicit lists and data.frames
Browse files Browse the repository at this point in the history
Fixes #466
Avoids recursion of list-like objects that aren't actually lists.
Recursion over data.frames is uncommon but was previously
supported and can, in theory, contain `JS()` calls in list columns.
  • Loading branch information
gadenbuie committed May 1, 2023
1 parent 261a718 commit ef71f98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ JSEvals <- function(list) {
#' @noRd
#' @keywords internal
shouldEval <- function(options) {
if (is.list(options)) {
if (inherits(options, c("list", "data.frame"))) {
if ((n <- length(options)) == 0) return(FALSE)
# use numeric indices as names (remember JS indexes from 0, hence -1 here)
if (is.null(names(options)))
Expand Down

0 comments on commit ef71f98

Please sign in to comment.