Skip to content

Commit

Permalink
fix: Restores eager recursion into options objects (#478)
Browse files Browse the repository at this point in the history
  • Loading branch information
gadenbuie authored Nov 27, 2023
1 parent b0f3d56 commit dec6c30
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# htmlwidgets (development version)

* htmlwidgets once again eagerly recurses into list-like objects when searching for JavaScript strings wrapped in `JS()`. If you encounter an infinite recursion ("C stack usage is too close to the limit"), the best strategy is to coerce the offending items to a character string. (#478)

# htmlwidgets 1.6.3

### Potentially breaking changes
Expand Down
3 changes: 2 additions & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ JSEvals <- function(list) {
#' @noRd
#' @keywords internal
shouldEval <- function(options) {
if (inherits(options, c("list", "data.frame"))) {
if (is.list(options)) {
if (inherits(options, "POSIXlt")) return(FALSE)
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 dec6c30

Please sign in to comment.