blob: 8eb1b75fb7ec4d4db27018c62c3a984b64466070 [file] [log] [blame]
keith_miller@apple.combcc77f22016-07-15 06:03:25 +00001// 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/*---
5description: >
6 Objects whose specified property is writable do not satisfy the assertion.
7includes: [propertyHelper.js]
8---*/
9
10var threw = false;
11var obj = {};
12Object.defineProperty(obj, 'a', {
13 writable: true,
14 value: 1
15});
16
17try {
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
29if (threw === false) {
30 $ERROR('Expected a Test262Error, but no error was thrown.');
31}