[Webkit-unassigned] [Bug 189136] Omitting an optional argument when calling a WebIDL operation results in a "required member" TypeError if the argument type is a dictionary with required members

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Aug 29 18:55:47 PDT 2018


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

--- Comment #1 from Andy Estes <aestes at apple.com> ---
CodeGeneratorJS.pm thinks that an optional dictionary without a default value has an implicit default value of []:

    if ($argument->isOptional && !defined($argument->default)) {
        # As per Web IDL, optional dictionary arguments are always considered to have a default value of an empty dictionary, unless otherwise specified.
        $argument->default("[]") if $codeGenerator->IsDictionaryType($type);

But [] is an invalid value for a dictionary with required members.

I can't find where in the WebIDL spec it says this should be the default, but I'm not super familiar with it.

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


More information about the webkit-unassigned mailing list