fogzot / vroomjs

Mono-friendly bridge to V8 Javascript engine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Examples wrong on main page

jaredoelderinkwale opened this issue · comments

The Example reads

"Execute some Javascript:

using (var js = new JsEngine()) {
var x = (int)js.Execute("3.14159+2.71828");
Console.WriteLine(x); // prints 5.85987
}
Create and return a Javascript object, then call a method on it:

using (var js = new JsEngine()) {
// Create a global variable on the JS side.
js.Execute("var x = {'answer':42, 'tellme':function (x) { return x+' '+this.answer; }}");
// Get it and use "dynamic" to tell the compiler to use runtime binding.
dynamic x = js.GetVariable("x");
// Call the method and print the result. This will print:
// "What is the answer to ...? The answer is: 42"
Console.WriteLine(x.tellme("What is the answer to ...?"));
}"

comment: "// "What is the answer to ...? The answer is: 42"" should be
""What is the answer to ...? 42" or Execute command should be
js.Execute("var x = {'answer':42, 'tellme':function (x) { return x+' The answer is: '+this.answer; }}");

Thanks, Jared.

Fixed. Thanks.