mirror of
https://github.com/rstudio/shiny.git
synced 2026-04-29 03:00:45 -04:00
Block some operators for shinyoutput objects
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
S3method("$",reactivevalues)
|
||||
S3method("$",shinyoutput)
|
||||
S3method("$<-",reactivevalues)
|
||||
S3method("$<-",shinyoutput)
|
||||
S3method("[",reactivevalues)
|
||||
S3method("[",shinyoutput)
|
||||
S3method("[<-",reactivevalues)
|
||||
S3method("[<-",shinyoutput)
|
||||
S3method("[[",reactivevalues)
|
||||
S3method("[[",shinyoutput)
|
||||
S3method("[[<-",reactivevalues)
|
||||
S3method("[[<-",shinyoutput)
|
||||
S3method("names<-",reactivevalues)
|
||||
|
||||
20
R/shiny.R
20
R/shiny.R
@@ -293,13 +293,31 @@ ShinyApp <- setRefClass(
|
||||
|
||||
#' @S3method $<- shinyoutput
|
||||
`$<-.shinyoutput` <- function(x, name, value) {
|
||||
x[['impl']]$defineOutput(name, value, deparse(substitute(value)))
|
||||
.subset2(x, 'impl')$defineOutput(name, value, deparse(substitute(value)))
|
||||
return(invisible(x))
|
||||
}
|
||||
|
||||
#' @S3method [[<- shinyoutput
|
||||
`[[<-.shinyoutput` <- `$<-.shinyoutput`
|
||||
|
||||
#' @S3method $ shinyoutput
|
||||
`$.shinyoutput` <- function(x, name) {
|
||||
stop("Reading objects from shinyoutput object not allowed.")
|
||||
}
|
||||
|
||||
#' @S3method [[ shinyoutput
|
||||
`[[.shinyoutput` <- `$.shinyoutput`
|
||||
|
||||
#' @S3method [ shinyoutput
|
||||
`[.shinyoutput` <- function(values, name) {
|
||||
stop("Single-bracket indexing of shinyoutput object is not allowed.")
|
||||
}
|
||||
|
||||
#' @S3method [<- shinyoutput
|
||||
`[<-.shinyoutput` <- function(values, name, value) {
|
||||
stop("Single-bracket indexing of shinyoutput object is not allowed.")
|
||||
}
|
||||
|
||||
resolve <- function(dir, relpath) {
|
||||
abs.path <- file.path(dir, relpath)
|
||||
if (!file.exists(abs.path))
|
||||
|
||||
Reference in New Issue
Block a user