1
0
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:
Robert Krimen
2014-05-28 21:23:32 -07:00
parent 526d3b2fd5
commit 918abeb8d8
40 changed files with 1232 additions and 1219 deletions

View File

@@ -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
}