Chromium Code Reviews| Index: test/mjsunit/es6/typedarray.js |
| diff --git a/test/mjsunit/es6/typedarray.js b/test/mjsunit/es6/typedarray.js |
| index ef7955ce928bfd80deff04bea4ef71f2ad8395cc..7b1cc06e1ce446f06bc0e0c74786c5d6179d0e5d 100644 |
| --- a/test/mjsunit/es6/typedarray.js |
| +++ b/test/mjsunit/es6/typedarray.js |
| @@ -417,6 +417,7 @@ var typedArrayConstructors = [ |
| function TestPropertyTypeChecks(constructor) { |
| function CheckProperty(name) { |
| + assertThrows(function() { 'use strict'; new constructor(10)[name] = 0; }) |
| var d = Object.getOwnPropertyDescriptor(constructor.prototype, name); |
|
adamk
2015/07/16 22:24:22
You can also test this more directly:
assertEqual
Dan Ehrenberg
2015/07/16 23:54:55
Acknowledged.
|
| var o = {}; |
| assertThrows(function() {d.get.call(o);}, TypeError); |
| @@ -756,3 +757,13 @@ TestArbitrary(new DataView(new ArrayBuffer(256))); |
| // Test direct constructor call |
| assertThrows(function() { ArrayBuffer(); }, TypeError); |
| assertThrows(function() { DataView(new ArrayBuffer()); }, TypeError); |
| + |
| +function TestNonConfigurableProperties(constructor) { |
| + var arr = new constructor([100]) |
| + assertFalse(Object.getOwnPropertyDescriptor(arr,"0").configurable) |
| + assertFalse(delete arr[0]) |
| +} |
| + |
| +for(i = 0; i < typedArrayConstructors.length; i++) { |
| + TestNonConfigurableProperties(typedArrayConstructors[i]); |
| +} |