Using objects for a mapping argument

Hi all, Tab and Anne suggested I ask about a use of objects here.

In https://api.csswg.org/bikeshed/?url=https://raw.githubusercontent.com/jyasskin/web-bluetooth-1/masked-data-prefixes/index.bs#device-discovery
defines some arguments to a function in which I want users to express
a map from integers or strings to a dictionary. One of the arguments
will look like {0x004C: {dataPrefix: [0x02, 0x15]}}, while the other
could be {0xFEAA: {dataPrefix: [0x10]}, "battery_service": {}}.

This is processed at
https://api.csswg.org/bikeshed/?url=https://raw.githubusercontent.com/jyasskin/web-bluetooth-1/masked-data-prefixes/index.bs#ref-for-dom-bluetoothlescanfilterinit-manufacturerdata-5
using explicit calls to `.[[OwnPropertyKeys]]()` and some other
ECMAScript operations.

Does this make sense, or should I have my users express these
arguments in some other way?

If this makes sense, would you like me to propose some WebIDL
operations that would make it easier?

Thanks,
Jeffrey

Received on Saturday, 24 September 2016 01:23:55 UTC