Matches when the argument at index equals value. Comparison is raw: no metamethods are consulted, so it tests identity for tables, Instances and functions, and value equality for strings, numbers and booleans.

Parameters

number
required
Which argument to inspect, starting at 1. Must be a whole number above 0.
any
required
The value to require. May be nil, which matches a call that omitted the argument.

Properties

number
The argument position. Writable.
any
The required value. Writable.
boolean
Defaults to false. When true, string comparison stops at the first embedded NUL, so "Kick\0junk" matches "Kick".

Behavior

  • Numbers compare by value. 5 and 5.0 are the same; "5" is not.
  • nil is a real choice. ArgumentFilter.new(1, nil) matches a call with no first argument, and does not match one that passed false.
  • StripNull is for sanitising hostile strings. Scripts sometimes append rubbish after a NUL to defeat exact matching; turn it on to ignore the tail.

Example

Errors