[Webkit-unassigned] [Bug 156939] Autogenerated IDBFactory.open() does the wrong thing if you pass an explicit 'undefined' as the second argument

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Apr 22 21:45:11 PDT 2016


https://bugs.webkit.org/show_bug.cgi?id=156939

--- Comment #8 from Chris Dumez <cdumez at apple.com> ---
Comment on attachment 277135
  --> https://bugs.webkit.org/attachment.cgi?id=277135
WIP patch

View in context: https://bugs.webkit.org/attachment.cgi?id=277135&action=review

> Source/WebCore/bindings/scripts/IDLAttributes.txt:130
> +UseOptionalForOptionalNumbericParametersWithoutDefaultValue

The flag should be reversed. This should be the default behavior and we should have a flag such as DoNotUseWTFOptionalForParameters on interfaces that have not been ported yet.

Note that when porting interfaces, we don't necessarily have to switch the implementation to use Optional<>. In most cases (but not the IDBFactory.open case), we can simply specify a default value in the IDL:
e.g. 
[RaisesException] ScriptProcessorNode createScriptProcessor(unsigned long bufferSize, optional unsigned long numberOfInputChannels, optional unsigned long numberOfOutputChannels);

would become
[RaisesException] ScriptProcessorNode createScriptProcessor(unsigned long bufferSize, optional unsigned long numberOfInputChannels = 2, optional unsigned long numberOfOutputChannels = 2);

and then the C++ implementation would stay unchanged since we only use WTF::Optional for parameters without a default value.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160423/cfebe391/attachment.html>


More information about the webkit-unassigned mailing list