Re: [heycam/webidl] Sort out when dictionaries and records should have default values (#76)

> You mean in the event that someone passes undefined?

Yes.   So given this IDL:

    dictionary Foo  {
      long x = 5;
    };
    [Constructor]
    interface Bar {
      void myMethod(optional Foo foo, long baz);
    };

and this JS:

    new Bar().myMethod(undefined, 3);

is there a reason to support the "foo" arg being missing as opposed to being an empty dictionary (or more precisely a dictionary with an `x` member whose value is `5`)?   And yes, this is a pretty weird API and people shouldn't really create APIs like this.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/76#issuecomment-425422576

Received on Friday, 28 September 2018 12:39:57 UTC