Re: [web-nfc] How to read/parse local types (#505)

Right. Completing the "parse Sp" algorithm will also need passing the context to the "parse record from bytes".

Currently "parse Sp" says

> 4. Let buffer be the byte sequence of ndefRecords's PAYLOAD field.
> 5. Set record's data to buffer. 

Then the app can call `toRecords()` on that record ('s data) which invokes [parse records from bytes](https://w3c.github.io/web-nfc/#dfn-parse-records-from-bytes). 

That has been fine when prefixing was not there, but now we need to pass the context to the invocation of [parse records from bytes](https://w3c.github.io/web-nfc/#dfn-parse-records-from-bytes) from within `toRecords()` and handle local types' parsing there. We cannot just pass local types any more, we need to translate them. 

I already feel nostalgic about the IMHO simpler `isLocal` :), but we should have passed context info to the parse algorithm anyway, so this has always been a miss, only uncovered now.



-- 
GitHub Notification of comment by zolkis
Please view or discuss this issue at https://github.com/w3c/web-nfc/issues/505#issuecomment-570508353 using your GitHub account

Received on Friday, 3 January 2020 08:59:39 UTC