Espruino/tests/test_arraybuffer_inheritance.js
Michael Duerinckx 7f5308590b Rename numbered tests to something more descriptive - closes #16
test077 is the only one I really couldn't figure out what it was meant
to test.
2014-03-01 22:15:28 +00:00

9 lines
230 B
JavaScript

// ArrayBuffer inheritance
var a = new Int16Array(16);
ArrayBufferView.prototype.foo = function () { return 42; };
ArrayBufferView.prototype.bar = function () { return this[1]; };
a[1] = 43;
result = a.foo()==42 && a.bar()==43;