Re: [heycam/webidl] Define a way to specify a default value for dictionaries (the literal "{}") and require it to be specified for the dictionary arguments that are required to be optional. (#750)

In both webidl2.js and bikeshed right now, this code is accepted:

```webidl
dictionary A {
  required long x;
};

dictionary B {
  A a = {};
};
```

but it seems like this ought to be invalid since `{}` is not a valid `A`. `= null` seems like it should equally not work.

Semi-related, I'm not sure I know what `dictionary C { A a; }` means. Does this allow `a` to be "A or undefined"? It seems that way in Chrome's bindings generator right now. We want it to work this way if possible in WebGPU.

https://github.com/gpuweb/gpuweb/issues/420

-- 
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/pull/750#issuecomment-536238161

Received on Sunday, 29 September 2019 01:22:25 UTC