Test coverage for jd_get_idx outside scope.