Quantcast
Channel: ClearScript
Viewing all articles
Browse latest Browse all 2297

New Post: Weird Parameter Passing Behavior

$
0
0
Hi again,

It looks like the failures in the code samples above are caused by the use of JavaScript return statements outside of a function:
engine.Evaluate("return d;"); // error
engine.Evaluate("d"); // OK
Also, JavaScript statements such as var don't have values, but expressions do, so if you'd like your script to return a value, make sure it ends with an expression:
engine.Evaluate("var d = 123"); // returns no value (undefined)
engine.Evaluate("var d = 123; d"); // returns 123
By the way, we'll post a fix for the VB.NET issue very soon.

Cheers!

Viewing all articles
Browse latest Browse all 2297

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>