99# ' @param code (`character`, `language` or `expression`) code to evaluate.
1010# ' It is possible to preserve original formatting of the `code` by providing a `character` or an
1111# ' `expression` being a result of `parse(keep.source = TRUE)`.
12- # ' @param keep_output (`logical(1)`) whether to keep the output of the code evaluation.
13- # '
1412# ' @param ... ([`dots`]) additional arguments passed to future methods.
1513# '
1614# ' @return
2826# ' @aliases eval_code,qenv.error-method
2927# '
3028# ' @export
31- setGeneric ("eval_code ", function(object, code, keep_output = FALSE, ...) standardGeneric("eval_code"))
29+ setGeneric ("eval_code ", function(object, code, ...) standardGeneric("eval_code"))
3230
33- setMethod ("eval_code ", signature = c(object = "qenv"), function(object, code, keep_output = FALSE, ...) {
31+ setMethod ("eval_code ", signature = c(object = "qenv"), function(object, code, ...) {
3432 if (! is.language(code ) && ! is.character(code )) {
3533 stop(" eval_code accepts code being language or character" )
3634 }
3735 code <- .preprocess_code(code )
3836 # preprocess code to ensure it is a character vector
39- .eval_code(object = object , code = code , keep_output = keep_output , ... )
37+ .eval_code(object = object , code = code , ... )
4038})
4139
42- setMethod ("eval_code ", signature = c(object = "qenv.error"), function(object, code, keep_output = FALSE, ...) object)
40+ setMethod ("eval_code ", signature = c(object = "qenv.error"), function(object, code, ...) object)
4341
4442# ' @keywords internal
45- .eval_code <- function (object , code , keep_output = FALSE , ... ) {
43+ .eval_code <- function (object , code , ... ) {
4644 if (identical(code , " " )) {
4745 return (object )
4846 }
@@ -63,10 +61,7 @@ setMethod("eval_code", signature = c(object = "qenv.error"), function(object, co
6361 x <- withCallingHandlers(
6462 tryCatch(
6563 {
66- out <- eval(current_call , envir = object @ .xData )
67- if (keep_output && i == length(code_split )) {
68- attr(current_code , " output" ) <- out
69- }
64+ eval(current_call , envir = object @ .xData )
7065 if (! identical(parent.env(object @ .xData ), parent.env(.GlobalEnv ))) {
7166 # needed to make sure that @.xData is always a sibling of .GlobalEnv
7267 # could be changed when any new package is added to search path (through library or require call)
0 commit comments