From ef65d004745e6514197aa6bdd6ebfa320c8a08bd Mon Sep 17 00:00:00 2001 From: Kevin Ushey Date: Tue, 20 Aug 2024 10:51:58 -0400 Subject: [PATCH] tweaks --- R/dotify.R | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/R/dotify.R b/R/dotify.R index 2effe4a..77f49bc 100644 --- a/R/dotify.R +++ b/R/dotify.R @@ -32,11 +32,15 @@ dotify <- function() { # tell codetools to accept our code's handlers # TODO: ask Luke nicely to allow us to do this + if (.BaseNamespaceEnv$bindingIsLocked("isUtilsVar", env = codetools)) { + .BaseNamespaceEnv$unlockBinding("isUtilsVar", env = codetools) + on.exit(.BaseNamespaceEnv$lockBinding("isUtilsVar", env = codetools), add = TRUE) + } + + # replace the binding hack <- function(v, env) TRUE environment(hack) <- codetools - .BaseNamespaceEnv$unlockBinding("isUtilsVar", env = codetools) assign("isUtilsVar", hack, envir = codetools) - .BaseNamespaceEnv$lockBinding("isUtilsVar", env = codetools) # add our handler for subset-assignment handler <- handlers$`[<-` %||% function(v, w) {}