name: duk_normalize_index proto: | duk_idx_t duk_normalize_index(duk_context *ctx, duk_idx_t idx); stack: | [ ... val! ... ] summary: |

Normalize argument index relative to the bottom of the current frame. The resulting index will be 0 or greater and will be independent of later stack modifications. If the input index is invalid, returns DUK_INVALID_INDEX. If you prefer that an error be thrown for an invalid index, use duk_require_normalize_index().

example: | duk_idx_t idx = duk_normalize_index(ctx, -3); tags: - stack seealso: - duk_require_normalize_index introduced: 1.0.0