add Variable.IsUndefined()
This commit is contained in:
parent
344c96d280
commit
d1f7baf054
1 changed files with 7 additions and 0 deletions
|
@ -153,3 +153,10 @@ func (v *Variable) String() string {
|
||||||
func (v *Variable) Object() objects.Object {
|
func (v *Variable) Object() objects.Object {
|
||||||
return *v.value
|
return *v.value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// IsUndefined returns true if the underlying value is undefined.
|
||||||
|
func (v *Variable) IsUndefined() bool {
|
||||||
|
_, isUndefined := (*v.value).(objects.Undefined)
|
||||||
|
|
||||||
|
return isUndefined
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue