diff --git a/R/render-cached-plot.R b/R/render-cached-plot.R index 9514bdce3..c52d8b834 100644 --- a/R/render-cached-plot.R +++ b/R/render-cached-plot.R @@ -105,6 +105,12 @@ renderCachedPlot <- function(expr, cacheKeyExpr, cacheInvalidationExpr = NULL, env = parent.frame(), quoted = FALSE, outputArgs = list() ) { + # This ..stacktraceon is matched by a ..stacktraceoff.. when plotFunc + # is called + installExprFunction(expr, "func", env, quoted, ..stacktraceon = TRUE) + + args <- list(...) + cacheKey <- reactive(substitute(cacheKeyExpr), env = parent.frame(), quoted = TRUE) cacheInvalidation <- reactive(substitute(cacheInvalidationExpr), @@ -187,12 +193,6 @@ renderCachedPlot <- function(expr, cacheKeyExpr, cacheInvalidationExpr = NULL, } ) - # This ..stacktraceon is matched by a ..stacktraceoff.. when plotFunc - # is called - installExprFunction(expr, "func", env, quoted, ..stacktraceon = TRUE) - - args <- list(...) - possible_dims <- all_possible_dims(baseWidth, aspectRatioRate, growthRate) # The width and height of the plot to draw, taken from possible_dims. These