File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 77#include "cnd.h"
88#include "globals.h"
99#include "obj.h"
10+ #include "rlang.h"
1011#include "sym.h"
1112
1213#define RLANG_USE_R_EXISTS (R_VERSION < R_Version(4, 2, 0))
@@ -59,15 +60,19 @@ r_obj* r_env_find_anywhere(r_obj* env, r_obj* sym) {
5960}
6061
6162#if R_VERSION < R_Version (4 , 5 , 0 )
63+ // Compatibility implementation for `R_getVar()`:
64+ // - Throws if not found
65+ // - Evaluates promises
6266static inline
6367r_obj * r_env_get (r_obj * env , r_obj * sym ) {
6468 r_obj * out = r_env_find (env , sym );
6569
6670 if (out == r_syms .unbound ) {
6771 r_abort ("object '%s' not found" , r_sym_c_string (sym ));
6872 }
73+
6974 if (r_typeof (out ) == R_TYPE_promise ) {
70- Rf_eval (out , env );
75+ return Rf_eval (out , env );
7176 }
7277
7378 return out ;
You can’t perform that action at this time.
0 commit comments