/usr/share/doc/r-cran-rlang/tests/testthat/helper-stack.R is in r-cran-rlang 0.2.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | fixup_calls <- function(x) {
cur_pos <- sys.nframe() - 1
x[seq(n+1, length(x))]
}
fixup_ctxt_depth <- function(x) {
x - (sys.nframe() - 1)
}
fixup_call_depth <- function(x) {
x - (call_depth() - 1)
}
fixup_call_trail <- function(trail) {
eval_callers <- ctxt_stack_callers()
cur_trail <- trail_make(eval_callers)
cur_pos <- eval_callers[1]
indices <- seq(1, length(trail) - length(cur_trail))
trail <- trail[indices]
trail - cur_pos
}
|