We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://github.com/robertkrimen/otto
It seems very interesting...
vm := otto.New() vm.Run(` abc = 2 + 2; console.log("The value of abc is " + abc); // 4 `)
vm.Set("sayHello", func(call otto.FunctionCall) otto.Value { fmt.Printf("Hello, %s.\n", call.Argument(0).String()) return otto.Value{} }) vm.Set("twoPlus", func(call otto.FunctionCall) otto.Value { right, _ := call.Argument(0).ToInteger() result, _ := vm.ToValue(2 + right) return result }) result, _ = vm.Run(` sayHello("Xyzzy"); // Hello, Xyzzy. sayHello(); // Hello, undefined result = twoPlus(2.0); // 4 `)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
https://github.com/robertkrimen/otto
It seems very interesting...
Run JavaScript inside Go!
Run Go inside JavaScript!
The text was updated successfully, but these errors were encountered: