I checked the latest maplike spec; https://heycam.github.io/webidl/#idl-maplike
It says "If the readonly keyword is used, this includes “entries”, “forEach”, “get”, “has”, “keys”, “values”, @@iterator methods and a “size” getter". So the spec seems to have the size already, IIUC?
Also, we already have the size getter.
Here is my trial in the DevTool console.
> navigator.requestMIDIAccess().then((a) => { _x = a; })
< Promise {[[PromiseStatus]]: "pending", [[PromiseValue]]: undefined}
> _x.inputs.size
< 1
Oops, I notice that it does not work correctly.
modules/webmidi/MIDI{Input|Output}Map.idl have size entries, but I didn't implement it, and auto-generated code counts wrong thing and maybe returns always 1 even though the map contains more MIDI{Input|Output}.
So anyway as foolip says, we need to remove explicit size entry from MIDI{Input|Output}Map, and the bindings should generate size entry to for maplike<>.
Comment 1 by dtapu...@chromium.org
, Feb 28 2017