| 1 |
// Copyright (c) 2012 Ecma International. All rights reserved. |
| 2 |
// This code is governed by the BSD license found in the LICENSE file. |
| 3 |
|
| 4 |
/*--- |
| 5 |
es5id: 15.2.3.7-6-a-28 |
| 6 |
description: > |
| 7 |
Object.defineProperties - 'P' doesn't exist in 'O', test |
| 8 |
[[Writable]] of 'P' is set as false value if absent in data |
| 9 |
descriptor 'desc' (8.12.9 step 4.a.i) |
| 10 |
includes: [propertyHelper.js] |
| 11 |
---*/ |
| 12 |
|
| 13 |
var obj = {}; |
| 14 |
|
| 15 |
Object.defineProperties(obj, { |
| 16 |
prop: { |
| 17 |
value: 1001 |
| 18 |
} |
| 19 |
}); |
| 20 |
|
| 21 |
if (isWritable(obj, "prop")) { |
| 22 |
$ERROR('Expected obj["prop"] not to be writable.'); |
| 23 |
} |
| 24 |
|
| 25 |
if (!obj.hasOwnProperty("prop")) { |
| 26 |
$ERROR('Expected obj.hasOwnProperty("prop") to be true, actually ' + obj.hasOwnProperty("prop")); |
| 27 |
} |
| 28 |
|
| 29 |
if (obj.prop !== 1001) { |
| 30 |
$ERROR('Expected obj.prop === 1001, actually ' + obj.prop); |
| 31 |
} |