Closed GoogleCodeExporter closed 9 years ago
It looks like this interface has already been removed in Chrome beta, so we
should probably just annotate requestMIDIAccess as:
@return {!Promise.<MIDIAccess>}
Original comment by tbreisac...@google.com
on 12 Apr 2014 at 12:04
Or I should say, I'm not sure if the interface is removed, but it looks like
what you get is just a Promise so there is no need for the compiler to know
about another type.
Original comment by tbreisac...@google.com
on 12 Apr 2014 at 12:06
Yep, you are correct. I was looking at Chrome 34 instead of Chrome 36, the
latter does indeed use a Promise.
In that case, how would the callbacks for "success" and "failure" be annotated
correctly - would it not be better to keep MIDIAccessPromise for the externs
and declare the interface as extending Promise?
Closure might need to be tweaked to handle annotated Promise callbacks unless
I'm overlooking something here :)
Original comment by RetroModular
on 12 Apr 2014 at 12:46
If you write {!Promise.<!MIDIAccess>} then the compiler should infer that the
success callback is a function that takes a MIDIAccess. The failure case, it
won't know, and I'm not sure if we have a good solution for that.
Original comment by tbreisac...@google.com
on 12 Apr 2014 at 12:51
Issue tracking has been migrated to github. Please make any further comments on
this issue through https://github.com/google/closure-compiler/issues
Original comment by blic...@google.com
on 1 May 2014 at 6:31
Original comment by blic...@google.com
on 1 May 2014 at 6:34
Original issue reported on code.google.com by
RetroModular
on 11 Apr 2014 at 9:27Attachments: