File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 1
1
# cpp11 (development version)
2
2
3
+ * ` cpp11::package ` now errors if given a package name that hasn't been loaded
4
+ yet. Previously it would cause R to hang indefinitely (#317 ).
5
+
3
6
* ` cpp11::function ` now protects its underlying function, for maximum safety
4
7
(#294 ).
5
8
Original file line number Diff line number Diff line change @@ -36,4 +36,8 @@ context("function-C++") {
36
36
37
37
close (con);
38
38
}
39
+
40
+ test_that (" unknown packages cause an error (#317)" ) {
41
+ expect_error_as (cpp11::package (" definitely_not_a_package" ), cpp11::unwind_exception);
42
+ }
39
43
}
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ class package {
68
68
return R_BaseEnv;
69
69
}
70
70
sexp name_sexp = safe[Rf_install](name);
71
- return safe[Rf_findVarInFrame ](R_NamespaceRegistry, name_sexp);
71
+ return safe[detail::r_env_get ](R_NamespaceRegistry, name_sexp);
72
72
}
73
73
74
74
// Either base env or in namespace registry, so no protection needed
You can’t perform that action at this time.
0 commit comments