diff --git a/script/variable.go b/script/variable.go index 51c7a84..81cc40f 100644 --- a/script/variable.go +++ b/script/variable.go @@ -153,3 +153,10 @@ func (v *Variable) String() string { func (v *Variable) Object() objects.Object { return *v.value } + +// IsUndefined returns true if the underlying value is undefined. +func (v *Variable) IsUndefined() bool { + _, isUndefined := (*v.value).(objects.Undefined) + + return isUndefined +}