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

Add remarks about ToValue & Otto.ToValue

This commit is contained in:
Robert Krimen
2013-02-04 10:41:17 -08:00
parent a879744c20
commit 795cc4935d
3 changed files with 17 additions and 0 deletions

View File

@@ -248,6 +248,7 @@ func (self Otto) Object(source string) (*Object, error) {
return nil, fmt.Errorf("Result was not an object")
}
// ToValue will convert an interface{} value to a value digestible by otto/JavaScript.
func (self Otto) ToValue(value interface{}) (Value, error) {
return self.runtime.ToValue(value)
}