Skip to content

Commit

Permalink
Have a default for envir
Browse files Browse the repository at this point in the history
  • Loading branch information
jennybc committed Nov 28, 2023
1 parent 4abcc2a commit a1b5a75
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion R/transformer.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#' @seealso `vignette("transformers", "glue")` for documentation on creating
#' custom glue transformers and some common use cases.
#' @export
identity_transformer <- function(text, envir) {
identity_transformer <- function(text, envir = parent.frame()) {
with_glue_error(
expr <- parse(text = text, keep.source = FALSE),
"Failed to parse glue component"
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/_snaps/transformer.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
Condition
Error:
! Failed to evaluate glue component {NOTFOUND}
Caused by error in `identity_transformer()`:
! argument "envir" is missing, with no default
Caused by error:
! object 'NOTFOUND' not found

0 comments on commit a1b5a75

Please sign in to comment.