mirror of
https://github.com/robertkrimen/otto
synced 2025-10-26 20:28:49 +08:00
The zero value of Value is now defined to be undefined
Previously, it was a publically accessible but invalid value (valueEmpty). * Deprecate internal use of UndefinedValue(), NullValue(), FalseValue(), TrueValue() * Guard against Empty, Result, Reference values from escaping the package
This commit is contained in:
4
stash.go
4
stash.go
@@ -98,7 +98,7 @@ func (self *_objectStash) getBinding(name string, throw bool) Value {
|
||||
if throw { // strict?
|
||||
panic(newReferenceError("Not Defined", name))
|
||||
}
|
||||
return UndefinedValue()
|
||||
return Value{}
|
||||
}
|
||||
|
||||
func (self *_objectStash) deleteBinding(name string) bool {
|
||||
@@ -208,7 +208,7 @@ func (self *_dclStash) getBinding(name string, throw bool) Value {
|
||||
if throw { // strict?
|
||||
panic(newTypeError())
|
||||
}
|
||||
return UndefinedValue()
|
||||
return Value{}
|
||||
}
|
||||
return property.value
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user