-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
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
Fix generator for variadic arguments #119
Comments
I tried to do this to have a variadic Is there a better JS-interop solution to that than this? createScriptURL(String input, [JSAny? arg1, JSAny? arg2, ..., argN]) {
// Figure out what _createScriptURL_N to call
}
@JS('createScriptURL')
external _createScriptURL_0(String input);
...
@JS('createScriptURL')
external _createScriptURL_N(String input, JSAny? arg1, JSAny? arg2, ..., JSAny? argN) |
@srujzs - now that we do a call-size expansion of the external calls, are we still passing placeholder values for optional args? Or are we leaving them out? |
We should be leaving them out. We used to have procedure-level lowerings for static interop at some point earlier in the year, but we moved to call-site level lowerings, meaning that if users did not provide an argument, we do not include it in the call. @ditman, this means that that first Re: the original bug, agreed we should generate several optional parameters. How many is up to us, but 3-6 has been our range in past interop offerings. |
Some IDLs contain variadic arguments, see for example https://www.npmjs.com/package/@webref/idl/v/3.39.1?activeTab=code:
We currently expose
createScriptURL
taking two arguments:We should probably instead expose:
See workaround in https://github.com/flutter/packages/pull/5581/files#diff-fef182cc76f54d7074aee070ced4ddd44ad9233ebf438472221dc834f5f342d9
cc @ditman @srujzs
The text was updated successfully, but these errors were encountered: