summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/extensions/arraybuffer-prototype.js
blob: c61b31776260d63db57fcaaab01ebec3f135843e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Any copyright is dedicated to the Public Domain.
// http://creativecommons.org/licenses/publicdomain/

//-----------------------------------------------------------------------------
var BUGNUMBER = 665961;
var summary =
  "ArrayBuffer cannot access properties defined on the prototype chain.";
print(BUGNUMBER + ": " + summary);

/**************
 * BEGIN TEST *
 **************/

ArrayBuffer.prototype.prop = "on prototype";
var b = new ArrayBuffer([]);
assertEq(b.prop, "on prototype");

var c = new ArrayBuffer([]);
assertEq(c.prop, "on prototype");
c.prop = "direct";
assertEq(c.prop, "direct");

assertEq(ArrayBuffer.prototype.prop, "on prototype");
assertEq(new ArrayBuffer([]).prop, "on prototype");

assertEq(c.nonexistent, undefined);

reportCompare(true, true);