| Index: test/mjsunit/harmony/typedarrays.js
|
| diff --git a/test/mjsunit/harmony/typedarrays.js b/test/mjsunit/harmony/typedarrays.js
|
| index 9b2cde6e7faeae30f38ba22dcab4f9281fc9923f..ef7955ce928bfd80deff04bea4ef71f2ad8395cc 100644
|
| --- a/test/mjsunit/harmony/typedarrays.js
|
| +++ b/test/mjsunit/harmony/typedarrays.js
|
| @@ -121,14 +121,6 @@
|
|
|
| // Typed arrays
|
|
|
| -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);
|
|
|
| @@ -277,7 +269,8 @@
|
| var a = new constr(ab, 64*elementSize, 128);
|
| assertEquals("[object " + constr.name + "]",
|
| Object.prototype.toString.call(a));
|
| - var desc = getPropertyDescriptor(constr.prototype, Symbol.toStringTag, 1);
|
| + var desc = Object.getOwnPropertyDescriptor(
|
| + constr.prototype, Symbol.toStringTag);
|
| assertTrue(desc.configurable);
|
| assertFalse(desc.enumerable);
|
| assertFalse(!!desc.writable);
|
| @@ -424,13 +417,17 @@
|
|
|
| function TestPropertyTypeChecks(constructor) {
|
| function CheckProperty(name) {
|
| - var d = getPropertyDescriptor(constructor.prototype, name, 1);
|
| + var d = Object.getOwnPropertyDescriptor(constructor.prototype, name);
|
| var o = {};
|
| assertThrows(function() {d.get.call(o);}, TypeError);
|
| for (var i = 0; i < typedArrayConstructors.length; i++) {
|
| var ctor = typedArrayConstructors[i];
|
| var a = new ctor(10);
|
| - d.get.call(a); // shouldn't throw, even from a different type
|
| + if (ctor === constructor) {
|
| + d.get.call(a); // shouldn't throw
|
| + } else {
|
| + assertThrows(function() {d.get.call(a);}, TypeError);
|
| + }
|
| }
|
| }
|
|
|
|
|