Closed
Description
It would be great if we could special case code generation so that trailing undefined
s are omitted from function invocations.
Example: Consider the following bindings (uncurried mode):
type dateFormatOptions = {someOption?: bool}
@module("SomeModule")
external formatDate: (Date.t, ~options: dateFormatOptions=?) => string = "formatDate"
Now
let x = formatDate(Date.make())
will compile to
var x = SomeModule.formatDate(new Date(), undefined);
which works, but has an unnecessary undefined
for the trailing optional parameter. It would be nice if that could be omitted.
Metadata
Metadata
Assignees
Labels
No labels