cwilso / WebMIDIAPIShim

Polyfill using the Jazz NPAPI MIDI plugin to implement the Web MIDI API on Mac and Windows.
380 stars 53 forks source link

Throw exception on spec change? #13

Closed notator closed 11 years ago

notator commented 11 years ago

I'm using the WebMIDIAPIShim to keep my project up to date with the spec, so it would be helpful if you simply threw an exception when I'm using a name which no longer exists. For example:

if (window.navigator.getMIDIAccess) {
    throw "Spec change: 'getMIDIAccess' has been renamed 'requestMIDIAccess'";
}
if (!window.navigator.requestMIDIAccess) {
    window.navigator.requestMIDIAccess = _requestMIDIAccess;
}

Could that be done?

cwilso commented 11 years ago

Instead of throwing, I started console.error()ing.

cwilso commented 11 years ago

Actually, I think it's console.warn, and I keep supporting the old version if possible.