diff options
Diffstat (limited to 'Godeps/_workspace/src/github.com/robertkrimen/otto/README.markdown')
-rw-r--r-- | Godeps/_workspace/src/github.com/robertkrimen/otto/README.markdown | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Godeps/_workspace/src/github.com/robertkrimen/otto/README.markdown b/Godeps/_workspace/src/github.com/robertkrimen/otto/README.markdown index 571743bf1..fe8e1bd4a 100644 --- a/Godeps/_workspace/src/github.com/robertkrimen/otto/README.markdown +++ b/Godeps/_workspace/src/github.com/robertkrimen/otto/README.markdown @@ -20,8 +20,10 @@ Run something in the VM Get a value out of the VM - value, err := vm.Get("abc") - value, _ := value.ToInteger() + if value, err := vm.Get("abc"); err == nil { + if value_int, err := value.ToInteger(); err == nil { + fmt.Printf("", value_int, err) + } } Set a number @@ -221,7 +223,7 @@ the interrupt channel to do this: Where is setTimeout/setInterval? These timing functions are not actually part of the ECMA-262 specification. -Typically, they belong to the `windows` object (in the browser). It would not be +Typically, they belong to the `window` object (in the browser). It would not be difficult to provide something like these via Go, but you probably want to wrap otto in an event loop in that case. |