// Data got copied correctly?
let buf2AsI8 = new Int8Array(buf2); for ( let i=0 ; i < buf2AsI8.length ; i++ )
assertEq(buf2AsI8[i], bufAsI8[base+i]);
// Storage not shared?
let correct = bufAsI8[base];
bufAsI8[base]++;
assertEq(buf2AsI8[0], correct);
// Start beyond end
let notail = buf.slice(buf.byteLength+1);
assertEq(notail.byteLength, 0);
// Negative start
let tail = buf.slice(-5, buf.byteLength);
assertEq(tail.byteLength, 5);
let tailAsI8 = new Int8Array(tail); for ( let i=0 ; i < tailAsI8.length ; i++ )
assertEq(tailAsI8[i], bufAsI8[buf.byteLength-5+i]);
// Negative end
let head = buf.slice(0, -5);
assertEq(head.byteLength, buf.byteLength-5);
let headAsI8 = new Int8Array(head); for ( let i=0 ; i < headAsI8.length ; i++ )
assertEq(headAsI8[i], bufAsI8[i]);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.