Skip to content

Commit

Permalink
Rename rlang::sexp_address() to rlang::obj_address() (#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
schloerke authored Apr 20, 2021
1 parent f4636dd commit a0342eb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,5 @@ import(rlang)
import(utils)
importFrom(fastmap,fastmap)
importFrom(fastmap,faststack)
importFrom(rlang,sexp_address)
importFrom(rlang,obj_address)
useDynLib(htmltools, .registration = TRUE)
10 changes: 5 additions & 5 deletions R/tag_query.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#' @importFrom fastmap fastmap faststack
#' @importFrom rlang sexp_address
#' @importFrom rlang obj_address
NULL


Expand Down Expand Up @@ -98,9 +98,9 @@ NULL
# tags before running the expr.


## rlang::sexp_address()
## rlang::obj_address()
# Use to get a unique key for stacks
# Use `env$envKey` over `rlang::sexp_address()`; 10x speed improvement
# Use `env$envKey` over `rlang::obj_address()`; 10x speed improvement

# Use for `has()` functionality
envirMap <- function() {
Expand Down Expand Up @@ -257,11 +257,11 @@ asTagEnv_ <- function(x, parent = NULL, seenMap = envirMap()) {
x <- safeListToEnv(xList, "htmltools.tag.env")
# add parent env and key
x$parent <- parent
x$envKey <- sexp_address(x)
x$envKey <- obj_address(x)
}
if (seenMap$has(x)) {
stop(
"Duplicate tag environment found: ", sexp_address(x), "\n",
"Duplicate tag environment found: ", obj_address(x), "\n",
"Call `lobstr::tree(x$root(), show_environments = TRUE)` to inspect the tag environments,\n",
"where `x` is your tag query object."
)
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-tag-query.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ test_that("asTagEnv upgrades objects", {
expect_s3_class(xTagEnv, "shiny.tag")

expect_null(xTagEnv$parent)
expect_equal(xTagEnv$envKey, sexp_address(xTagEnv))
expect_equal(xTagEnv$envKey, obj_address(xTagEnv))
expect_equal(xTagEnv$name, x$name)
expect_equal(xTagEnv$attribs, x$attribs)

Expand Down

0 comments on commit a0342eb

Please sign in to comment.