Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinushey committed Aug 20, 2024
1 parent c235aba commit ef65d00
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions R/dotify.R
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}
Expand Down

0 comments on commit ef65d00

Please sign in to comment.