Yuari
Documentation
Docs/Debug/debug.isvalidlevel

debug.isvalidlevel

Checks whether a stack level points to a valid debug frame.

Syntax

debug.isvalidlevel(level: number) -> boolean

Parameters

ParameterTypeDescription
levelnumberThe level value used by the call.

Returns

TypeDescription
booleanThe boolean result of the check.

Description

debug.isvalidlevel is part of the Debug library. The debug library exposes the internals of the active Luau state, including protos, constants, upvalues and stack frames.

The call is a predicate: it inspects the current state and returns a boolean without modifying anything.

The aliases validlevel(level) resolve to the same implementation.

Example

print(debug.isvalidlevel(1), validlevel(1))

Notes

  • Aliases: validlevel(level).
  • Writing protos, constants or upvalues can corrupt a running function; test changes carefully.