1
0
mirror of https://github.com/robertkrimen/otto synced 2025-10-26 20:28:49 +08:00

Shortcut the production of Object.Value()

This commit is contained in:
Robert Krimen
2012-10-11 18:22:00 -07:00
parent c57edbfe2b
commit 02929cbeb1
3 changed files with 10 additions and 4 deletions

View File

@@ -379,9 +379,9 @@ func (value Value) _object() *_object {
//
// This method will not do any implicit conversion. For example, calling this method on a string primitive value will not return a String object.
func (value Value) Object() *Object {
switch value := value.value.(type) {
switch object := value.value.(type) {
case *_object:
return _newObject(value)
return _newObject(object, value)
}
return nil
}