Skip to content

Commit 91e9c06

Browse files
authored
Use bindingIsActive (#1031)
1 parent 1ebb8f2 commit 91e9c06

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

R/session/vsc.R

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ inspect_env <- function(env, cache) {
136136
all_names <- ls(env)
137137
rm(list = setdiff(names(globalenv_cache), all_names), envir = cache)
138138
is_promise <- rlang::env_binding_are_lazy(env, all_names)
139-
is_active <- rlang::env_binding_are_active(env, all_names)
140139
show_object_size <- getOption("vsc.show_object_size", FALSE)
141140
object_length_limit <- getOption("vsc.object_length_limit", 2000)
142141
object_timeout <- getOption("vsc.object_timeout", 50) / 1000
@@ -149,7 +148,7 @@ inspect_env <- function(env, cache) {
149148
length = scalar(0L),
150149
str = scalar("(promise)")
151150
)
152-
} else if (is_active[[name]]) {
151+
} else if (bindingIsActive(name, env)) {
153152
info <- list(
154153
class = "active_binding",
155154
type = scalar("active_binding"),
@@ -409,7 +408,6 @@ if (show_view) {
409408
if (is.environment(x)) {
410409
all_names <- ls(x)
411410
is_promise <- rlang::env_binding_are_lazy(x, all_names)
412-
is_active <- rlang::env_binding_are_active(x, all_names)
413411
x <- lapply(all_names, function(name) {
414412
if (is_promise[[name]]) {
415413
data.frame(
@@ -421,7 +419,7 @@ if (show_view) {
421419
stringsAsFactors = FALSE,
422420
check.names = FALSE
423421
)
424-
} else if (is_active[[name]]) {
422+
} else if (bindingIsActive(name, x)) {
425423
data.frame(
426424
class = "active_binding",
427425
type = "active_binding",

0 commit comments

Comments
 (0)