keith_miller@apple.com | bcc77f2 | 2016-07-15 06:03:25 +0000 | [diff] [blame] | 1 | // Copyright (C) 2015 the V8 project authors. All rights reserved. |
| 2 | // This code is governed by the BSD license found in the LICENSE file. |
| 3 | |
| 4 | /*--- |
| 5 | description: > |
| 6 | Objects whose specified property is writable do not satisfy the assertion. |
| 7 | includes: [propertyHelper.js] |
| 8 | ---*/ |
| 9 | |
| 10 | var threw = false; |
| 11 | var obj = {}; |
| 12 | Object.defineProperty(obj, 'a', { |
| 13 | writable: true, |
| 14 | value: 1 |
| 15 | }); |
| 16 | |
| 17 | try { |
| 18 | verifyNotWritable(obj, 'a'); |
| 19 | } catch(err) { |
| 20 | threw = true; |
| 21 | if (err.constructor !== Test262Error) { |
| 22 | $ERROR( |
| 23 | 'Expected a Test262Error, but a "' + err.constructor.name + |
| 24 | '" was thrown.' |
| 25 | ); |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | if (threw === false) { |
| 30 | $ERROR('Expected a Test262Error, but no error was thrown.'); |
| 31 | } |