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

Commented Feature: Support for specifying host method arguments by name [80]

$
0
0
Neither JavaScript nor VBScript have native support for named arguments, but some way to specify host method arguments by name might be useful.
Comments: Hi, Object literal syntax should be a nice alternative. I don't know what host.args would return to make Console.WriteLine work. engine.Execute(@" Console.WriteLine(host.args({ format: 'Pi = {0}', arg0: Math.PI })); "); Just to avoid host.args from being part of every line of the script can the engine somehow detect that Console.WriteLine (or any other such exposed method) expects multiple (or non-object) parameters but is being passed an object and accordingly do whatever host.args plans to do? engine.Execute(@" Console.WriteLine({ format: 'Pi = {0}', arg0: Math.PI }); "); So that the script would look like above which would be great. Regards, Ram

Viewing all articles
Browse latest Browse all 2297

Latest Images

Trending Articles





Latest Images