Update web-platform-tests to revision 424249088dd679888e07bd315dd8ebc98ccf323a

This commit is contained in:
WPT Sync Bot 2019-11-03 10:24:12 +00:00
parent 4ad08fff04
commit bca3835607
93 changed files with 1641 additions and 291 deletions

View file

@ -31,14 +31,16 @@ function toMojoNDEFRecord(record) {
return nfcRecord;
}
// Converts JS objects to byte array.
function toByteArray(data) {
// Converts JS objects to byte array.
if (data instanceof ArrayBuffer)
return new Uint8Array(data);
else if (ArrayBuffer.isView(data))
return new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
let byteArray = new Uint8Array(0);
let tmpData = data;
if (tmpData instanceof ArrayBuffer)
byteArray = new Uint8Array(tmpData);
else if (typeof tmpData === 'object' || typeof tmpData === 'number')
if (typeof tmpData === 'object' || typeof tmpData === 'number')
tmpData = JSON.stringify(tmpData);
if (typeof tmpData === 'string')