File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 66* ` env_unlock() ` is now defunct because recent versions of R no long
77 make it possible to unlock an environment (#1705 ). Make sure to use an
88 up-to-date version of pkgload (>= 1.4.0) following this change.
9+
10+ * ` is_dictionaryish() ` now will return TRUE for NULL (@ilovemane , #1712 ).
911
1012
1113# rlang 1.1.4
Original file line number Diff line number Diff line change 2020# ' a logical vector as long as the input.
2121# '
2222# ' @details
23- # ' `is_named()` always returns `TRUE` for empty vectors because
23+ # ' `is_named()` always returns `TRUE` for empty vectors because
2424# '
2525# ' @examples
2626# ' # is_named() is a scalar predicate about the whole vector of names:
@@ -110,6 +110,10 @@ detect_void_name <- function(x) {
110110is_dictionaryish <- function (x ) {
111111 # 2022-01: Used in many packages. Don't deprecate without a
112112 # replacement.
113+ if (is.null(x )) {
114+ return (TRUE )
115+ }
116+
113117 if (! length(x )) {
114118 return (! is.null(x ))
115119 }
@@ -118,6 +122,7 @@ is_dictionaryish <- function(x) {
118122}
119123
120124
125+
121126# ' Does an object have an element with this name?
122127# '
123128# ' This function returns a logical value that indicates if a data
Original file line number Diff line number Diff line change @@ -186,3 +186,8 @@ test_that("zap_srcref() works on calls", {
186186 expect_null(attributes(zap_srcref(call )))
187187 expect_true(" srcref" %in% names(attributes(call )))
188188})
189+
190+ test_that(" is_dictionaryish return true if is NULL" , {
191+
192+ expect_true(is_dictionaryish(NULL ))
193+ })
You can’t perform that action at this time.
0 commit comments