- From: L. David Baron via GitHub <sysbot+gh@w3.org>
- Date: Tue, 17 Dec 2019 23:02:21 +0000
- To: public-web-nfc@w3.org
dbaron has just created a new issue for https://github.com/w3c/web-nfc: == NDEFReader.scan should say when it resolves and returns the promise p == So reading through the examples in [the explainer](https://github.com/w3c/web-nfc/blob/gh-pages/EXPLAINER.md), one thing I wondered was that it seems a little odd to do the asynchronous `await reader.scan()` and *then* set the `reader.onreading` property to an event handler. It made me wonder whether the `reading` events could happen *during* the `reader.scan()` call. So I decided to look at the [spec text for `reader.scan()`](https://w3c.github.io/web-nfc/#dom-ndefreader-scan) to understand whether this is the case -- and I ran into a problem. As far as I can tell, nothing in that algorithm ever resolves and returns `p` in the success case -- which seems to imply that the function never returns at all! I think there should be something in that spec text that says to resolve `p` and return it in the success case. (At least I think that's how promise-using specifications are supposed to be written, although I suppose there actually isn't anything in the [promises guide](https://www.w3.org/2001/tag/doc/promises-guide) saying so.) (I got here from w3ctag/design-reviews#461.) Please view or discuss this issue at https://github.com/w3c/web-nfc/issues/478 using your GitHub account
Received on Tuesday, 17 December 2019 23:02:23 UTC