| Index: test/mjsunit/harmony/reflect.js
|
| diff --git a/test/mjsunit/harmony/reflect.js b/test/mjsunit/harmony/reflect.js
|
| index 73d0115db916f3d7041ae3333d7dc9f059e09220..ce519602329632af6890648d95328186c936a853 100644
|
| --- a/test/mjsunit/harmony/reflect.js
|
| +++ b/test/mjsunit/harmony/reflect.js
|
| @@ -177,6 +177,41 @@ function prepare(tgt) {
|
|
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
| +// Reflect.defineProperty
|
| +
|
| +
|
| +(function testReflectDefinePropertyArity() {
|
| + assertEquals(3, Reflect.defineProperty.length);
|
| +})();
|
| +
|
| +
|
| +(function testReflectDefinePropertyOnNonObject() {
|
| + assertThrows(function() { Reflect.defineProperty(); }, TypeError);
|
| + assertThrows(function() { Reflect.defineProperty(42, "bla"); }, TypeError);
|
| + assertThrows(function() { Reflect.defineProperty(null, "bla"); }, TypeError);
|
| + assertThrows(function() { Reflect.defineProperty({}, "bla"); }, TypeError);
|
| + assertThrows(function() { Reflect.defineProperty({}, "bla", 42); },
|
| + TypeError);
|
| + assertThrows(function() { Reflect.defineProperty({}, "bla", null); },
|
| + TypeError);
|
| +})();
|
| +
|
| +
|
| +(function testReflectDefinePropertyKeyConversion() {
|
| + var tgt = {};
|
| + var a = { [Symbol.toPrimitive]: function() { return "bla" } };
|
| + var b = { [Symbol.toPrimitive]: function() { throw "gaga" } };
|
| + assertTrue(Reflect.defineProperty(tgt, a, {value: 42}));
|
| + assertEquals(tgt.bla, 42);
|
| + assertThrows(function() { Reflect.defineProperty(tgt, b); }, "gaga");
|
| +})();
|
| +
|
| +
|
| +// See reflect-define-property.js for further tests.
|
| +
|
| +
|
| +
|
| +////////////////////////////////////////////////////////////////////////////////
|
| // Reflect.deleteProperty
|
|
|
|
|
|
|