Skip to content

Commit

Permalink
evaluate package in outer environment, force evaluation (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmbarbone committed Dec 5, 2024
1 parent 575fe36 commit 767e629
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions R/condition.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ new_condition <- function( # nolint cyclocomp_linter,
if (!length(class) == 1L && !is.character(class)) {
stop(cond_new_conditional_class())
}


force(package)
type <- as.character(type)
type <- match.arg(type)
class <- as.character(class)
Expand Down Expand Up @@ -109,7 +110,7 @@ cond_new_conditional_pkg <- function() {
)
}

package <- function(env = parent.frame()) {
package <- function(env = parent.frame(2L)) {
top <- topenv(env)
if (isNamespace(top)) {
unname(getNamespaceName(top))
Expand Down

0 comments on commit 767e629

Please sign in to comment.