Index: test/mjsunit/harmony/reflect.js |
diff --git a/test/mjsunit/harmony/reflect.js b/test/mjsunit/harmony/reflect.js |
index c410cf903258cec7b8fd529f3cdf46b6fb7e790a..a2b56e5a10b8a14ad16c95ff7b36a941c60218c6 100644 |
--- a/test/mjsunit/harmony/reflect.js |
+++ b/test/mjsunit/harmony/reflect.js |
@@ -361,6 +361,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}; |
+ 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. |
+ |
+ |
+ |
+//////////////////////////////////////////////////////////////////////////////// |
// Reflect.preventExtensions |