Skip to content

Commit 28c239b

Browse files
committed
Merge pull request #244 from RcppCore/bugfix/eval-interruption
Use R_ToplevelExec when evaluating R code
2 parents e47cd95 + 30a2121 commit 28c239b

File tree

4 files changed

+312
-230
lines changed

4 files changed

+312
-230
lines changed

ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2015-02-02 JJ Allaire <jj@rstudio.org>
2+
3+
* R/exceptions.R: Evaluate R code within an R_toplevelExec block
4+
* include/Rcpp/api/meat/Rcpp_eval.h: Evaluate R code within an
5+
R_toplevelExec block
6+
17
2015-01-25 Kevin Ushey <kevinushey@gmail.com>
28

39
* inst/include/Rcpp/utils/tinyformat.h: define an error handler for

R/exceptions.R

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,18 @@
1919
invisible( .Call( rcpp_error_recorder, e ) )
2020
}
2121

22+
.warningsEnv <- new.env()
23+
.warningsEnv$warnings <- character()
24+
25+
.rcpp_warning_recorder <- function(w){
26+
.warningsEnv$warnings <- append(.warningsEnv$warnings, w$message)
27+
invokeRestart("muffleWarning")
28+
}
29+
30+
.rcpp_collect_warnings <- function() {
31+
warnings <- .warningsEnv$warnings
32+
.warningsEnv$warnings <- character()
33+
warnings
34+
}
35+
36+

0 commit comments

Comments
 (0)