<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Autogenerated IDBFactory.open() does the wrong thing if you pass an explicit 'undefined' as the second argument"
   href="https://bugs.webkit.org/show_bug.cgi?id=156939#c8">Comment # 8</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Autogenerated IDBFactory.open() does the wrong thing if you pass an explicit 'undefined' as the second argument"
   href="https://bugs.webkit.org/show_bug.cgi?id=156939">bug 156939</a>
              from <span class="vcard"><a class="email" href="mailto:cdumez&#64;apple.com" title="Chris Dumez &lt;cdumez&#64;apple.com&gt;"> <span class="fn">Chris Dumez</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=277135&amp;action=diff" name="attach_277135" title="WIP patch">attachment 277135</a> <a href="attachment.cgi?id=277135&amp;action=edit" title="WIP patch">[details]</a></span>
WIP patch

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=277135&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=277135&amp;action=review</a>

<span class="quote">&gt; Source/WebCore/bindings/scripts/IDLAttributes.txt:130
&gt; +UseOptionalForOptionalNumbericParametersWithoutDefaultValue</span >

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&lt;&gt;. 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.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>