Chromium Code Reviews| Index: test/mjsunit/harmony/reflect.js |
| diff --git a/test/mjsunit/harmony/reflect.js b/test/mjsunit/harmony/reflect.js |
| index 73d0115db916f3d7041ae3333d7dc9f059e09220..c169e012454ec515d29289d37e840ff66553d6b9 100644 |
| --- a/test/mjsunit/harmony/reflect.js |
| +++ b/test/mjsunit/harmony/reflect.js |
| @@ -326,6 +326,38 @@ function prepare(tgt) { |
| //////////////////////////////////////////////////////////////////////////////// |
| +// Reflect.getOwnPropertyDescriptor |
| + |
| + |
| +(function testReflectGetOwnPropertyDescriptorArity() { |
| + assertEquals(2, Reflect.getOwnPropertyDescriptor.length); |
| +})(); |
| + |
| + |
| +(function testReflectGetOwnPropertyDescriptorOnNonObject() { |
| + assertThrows(function() { Reflect.getOwnPropertyDescriptor(); }, TypeError); |
| + assertThrows(function() { Reflect.getOwnPropertyDescriptor(42); }, |
| + TypeError); |
| + assertThrows(function() { Reflect.getOwnPropertyDescriptor(null); }, |
| + TypeError); |
| +})(); |
| + |
| + |
| +(function testReflectGetOwnPropertyDescriptorKeyConversion() { |
| + var tgt = {bla: 42}; |
|
Jakob Kummerow
2015/10/26 13:58:26
nit: s/tgt/target/
Jakob Kummerow
2015/10/29 18:06:02
Forgot this?
neis
2015/10/30 08:41:30
Done.
|
| + var a = { [Symbol.toPrimitive]: function() { return "bla" } }; |
| + var b = { [Symbol.toPrimitive]: function() { throw "gaga" } }; |
| + assertEquals(42, Reflect.getOwnPropertyDescriptor(tgt, a).value); |
| + assertThrows(function() { Reflect.getOwnPropertyDescriptor(tgt, b); }, |
| + "gaga"); |
| +})(); |
| + |
| + |
| +// See reflect-get-own-property-descriptor.js for further tests. |
|
Jakob Kummerow
2015/10/26 13:58:26
Any particular reason why the tests are split acro
|
| + |
| + |
| + |
| +//////////////////////////////////////////////////////////////////////////////// |
| // Reflect.preventExtensions |