-
-
Save bnoordhuis/44994f7a3f366b0dceaa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function assert(e) { | |
if (!e) throw new Error('assert failed'); | |
} | |
assert.equal = function(a, b) { return assert(a === b) }; | |
assert.notEqual = function(a, b) { return assert(a !== b) }; | |
//(function() { | |
// Backing store should not be shared. | |
var a = new Uint8Array(2); | |
var b = new Uint16Array(a); | |
a[0] = 0; | |
a[1] = 0; | |
b[0] = 257; | |
assert.equal(a[0], 0); | |
assert.equal(a[1], 0); | |
assert.equal(b[0], 257); | |
assert.notEqual(a, b.buffer); | |
assert.equal(a.length, 2); | |
assert.equal(b.length, 2); | |
//})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment