| Index: test/mjsunit/harmony/sharedarraybuffer.js
|
| diff --git a/test/mjsunit/harmony/sharedarraybuffer.js b/test/mjsunit/harmony/sharedarraybuffer.js
|
| index bac42681ab32fd1f521b976e65c96fbb79b2cd2a..cdbf102e87bcf70de5070149f42c958aff6fe122 100644
|
| --- a/test/mjsunit/harmony/sharedarraybuffer.js
|
| +++ b/test/mjsunit/harmony/sharedarraybuffer.js
|
| @@ -87,6 +87,14 @@ function MakeSharedTypedArray(constr, numElements) {
|
| return new constr(sab);
|
| }
|
|
|
| +function getPropertyDescriptor(object, field, expectedDepth) {
|
| + for (var depth = 0; depth < expectedDepth; depth++) {
|
| + assertFalse(Object.hasOwnProperty(object, field));
|
| + object = object.__proto__;
|
| + }
|
| + return Object.getOwnPropertyDescriptor(object, field);
|
| +}
|
| +
|
| function TestTypedArray(constr, elementSize, typicalElement) {
|
| assertSame(elementSize, constr.BYTES_PER_ELEMENT);
|
|
|
| @@ -203,8 +211,7 @@ function TestTypedArray(constr, elementSize, typicalElement) {
|
| var a = new constr(sab, 64*elementSize, 128);
|
| assertEquals("[object " + constr.name + "]",
|
| Object.prototype.toString.call(a));
|
| - var desc = Object.getOwnPropertyDescriptor(
|
| - constr.prototype, Symbol.toStringTag);
|
| + var desc = getPropertyDescriptor(constr.prototype, Symbol.toStringTag, 1);
|
| assertTrue(desc.configurable);
|
| assertFalse(desc.enumerable);
|
| assertFalse(!!desc.writable);
|
| @@ -310,17 +317,13 @@ var typedArrayConstructors = [
|
|
|
| function TestPropertyTypeChecks(constructor) {
|
| function CheckProperty(name) {
|
| - var d = Object.getOwnPropertyDescriptor(constructor.prototype, name);
|
| + var d = getPropertyDescriptor(constructor.prototype, name, 1);
|
| var o = {};
|
| assertThrows(function() {d.get.call(o);}, TypeError);
|
| for (var i = 0; i < typedArrayConstructors.length; i++) {
|
| var ctor = typedArrayConstructors[i];
|
| var a = MakeSharedTypedArray(ctor, 10);
|
| - if (ctor === constructor) {
|
| - d.get.call(a); // shouldn't throw
|
| - } else {
|
| - assertThrows(function() {d.get.call(a);}, TypeError);
|
| - }
|
| + d.get.call(a); // shouldn't throw on any type
|
| }
|
| }
|
|
|
|
|