Skip to content
This repository has been archived by the owner on Mar 9, 2021. It is now read-only.

An option to prevent passing not specifed optional arguments? #376

Open
n9 opened this issue Jan 6, 2015 · 2 comments
Open

An option to prevent passing not specifed optional arguments? #376

n9 opened this issue Jan 6, 2015 · 2 comments

Comments

@n9
Copy link

n9 commented Jan 6, 2015

Sometimes, JavaScript libraries use arguments.length variable to access arguments passed to a function. Saltarelle substitutes not specified optional arguments with their default values. This is good for C# code, however it is not convenient for JavaScript interop scenarios, as one mentioned.

Is there an attribute that could be specified on a method or a delegate that optional arguments are not passed or passed as undefined?

Currently, the only way I know is to create multiple overloads of a same function.

@n9
Copy link
Author

n9 commented Jan 6, 2015

It is also not possible to use Script.Undefined instead of null, since it is not a compile-time constant.

@erik-kallen erik-kallen added this to the 3.0 milestone Jan 7, 2015
@erik-kallen
Copy link
Contributor

In v3 there will be an attribute [OmitArgumentsFrom(n)] which can be used for this purpose.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants