Re: [heycam/webidl] Represent objects with both specified and unspecified members (#568)

Above we have two use cases described:

1.  The webrtc one.  This has effectively a union of dictionaries as a return value.  A union of dictionaries is not expressible in idl, so it ends up using `object`.  To produce the object, it takes whatever dictionary it has (which varies based on the map key string) and converts it to an object.  There's no "unspecified fields" involved.

2.  The keyframe case.  That case is basically trying to avoid hardcoding a list of names, for efficiency reasons.  The option of just doing a [[Get]] for every CSS property name by listing them all in the dictionary was in fact considered, and decided to be too slow.

This _could_ be addressed by something which acts like a dictionary but also snapshots the set of property names and values on the object or something.  But we have exactly one use case so far, and it's not clear that anyone else will want to do this, and if so whether they would want it to work the way the keyframe case does (e.g. ignoring prototype properties).

-- 
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/568#issuecomment-400176939

Received on Tuesday, 26 June 2018 04:45:22 UTC