(loc, tuple_type, input_index, allow_out_of_bounds)
| 17849 | } |
| 17850 | } |
| 17851 | getAdjTupleIndex(loc, tuple_type, input_index, allow_out_of_bounds) { |
| 17852 | let adj_index = input_index; |
| 17853 | const tuple_len = tuple_type.elements().length; |
| 17854 | if (input_index < 0) { |
| 17855 | adj_index = tuple_len + input_index; |
| 17856 | } |
| 17857 | if (!allow_out_of_bounds && (adj_index >= tuple_len || adj_index < 0)) { |
| 17858 | throw new python.Error(`Tuple index out of range at ${loc}.`); |
| 17859 | } |
| 17860 | return adj_index; |
| 17861 | } |
| 17862 | emitTupleIndex(loc, tuple_val, idx_val) { |
| 17863 | const tuple_typ = tuple_val.type(); |
| 17864 | const elems = tuple_typ.elements(); |
no test coverage detected