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

Fix .ToValue([]string{...}).Export() to return []string{...}

This fixes #24
This commit is contained in:
Robert Krimen
2013-06-06 20:18:37 -07:00
parent 4aa7e8cc36
commit 30e4c4b96d
2 changed files with 16 additions and 0 deletions

View File

@@ -624,6 +624,8 @@ func (self Value) export() interface{} {
return value.value.Interface()
case *_goArrayObject:
return value.value.Interface()
case *_goSliceObject:
return value.value.Interface()
}
if object.class == "Array" {
result := make([]interface{}, 0)
@@ -677,6 +679,8 @@ func (self Value) exportNative() interface{} {
return value.value.Interface()
case *_goArrayObject:
return value.value.Interface()
case *_goSliceObject:
return value.value.Interface()
}
}