oliver@apple.com | 41c899b | 2009-09-19 22:14:56 +0000 | [diff] [blame] | 1 | Test to ensure correct behaviour of Object.defineProperties |
| 2 | |
| 3 | On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". |
| 4 | |
| 5 | |
| 6 | PASS Object.defineProperties() threw exception TypeError: Properties can only be defined on Objects.. |
| 7 | PASS Object.defineProperties('a string') threw exception TypeError: Properties can only be defined on Objects.. |
barraclough@apple.com | e2ea07b | 2012-02-16 19:06:03 +0000 | [diff] [blame] | 8 | PASS Object.defineProperties({}, 'a string') threw exception TypeError: Property description must be an object.. |
oliver@apple.com | 41c899b | 2009-09-19 22:14:56 +0000 | [diff] [blame] | 9 | PASS JSON.stringify(Object.defineProperties({},{property:{value:'foo', enumerable:true}, property2:{value:'foo', enumerable:true}})) is '{"property":"foo","property2":"foo"}' |
| 10 | PASS JSON.stringify(Object.defineProperties({},{property:{value:'foo'}, property2:{value:'foo', enumerable:true}})) is '{"property2":"foo"}' |
| 11 | PASS JSON.stringify(Object.defineProperties({property:'foo'},{property:{value:'foo', enumerable:true}, property2:{value:'foo', enumerable:true}})) is '{"property":"foo","property2":"foo"}' |
| 12 | PASS JSON.stringify(Object.defineProperties({property:'foo'},{property:{value:'foo', enumerable:false}, property2:{value:'foo', enumerable:true}})) is '{"property2":"foo"}' |
| 13 | PASS JSON.stringify(Object.defineProperties({property:'foo'},{property:{value:'foo'}, property2:{value:'foo', enumerable:true}})) is '{"property":"foo","property2":"foo"}' |
| 14 | PASS Object.defineProperties(emptyObject, {foo:{value: true}, bar:{get:function(){}, writable:true}}) threw exception TypeError: Invalid property. 'writable' present on property with getter or setter.. |
| 15 | PASS 'foo' in emptyObject is false |
| 16 | PASS successfullyParsed is true |
| 17 | |
| 18 | TEST COMPLETE |
| 19 | |