Open zolkis opened 4 years ago
For what it's worth, current implementation of Web NFC in Chromium raises a TypeError when NDEFRecord is constructed with invalid arguments.
new NDEFRecord({ recordType: "foo" });
> VM89:2 Uncaught TypeError: Failed to construct 'NDEFRecord': Invalid NDEFRecord type.
The ctor of NDEFRecord takes an NDEFRecordInit, so isn't it handled then?
For what it's worth, current implementation of Web NFC in Chromium raises a TypeError when NDEFRecord is constructed with invalid arguments.
See also: #622
@sleevi notes here:
In principle we create NDEFRecord only when reading and we use NDEFRecordInit in push().
However, you are right that clients could just construct an
NDEFRecord
and that may warrant validation. Not that there is much they could do with them, since push will treat them asNDEFRecordInit
and will create a newNDEFRecord
out of them before pushing.@kenchris @beaufortfrancois please advise.