| 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 |
info: | |
| 6 |
Refer 11.1.5; |
| 7 |
The production |
| 8 |
PropertyNameAndValueList : PropertyAssignment |
| 9 |
3.Call the [[DefineOwnProperty]] internal method of obj with arguments propId.name, propId.descriptor, and false. |
| 10 |
es5id: 11.1.5_3-3-1 |
| 11 |
description: > |
| 12 |
Object initialization using PropertyNameAndValueList |
| 13 |
(PropertyAssignment) when property (read-only) exists in |
| 14 |
Object.prototype (step 3) |
| 15 |
---*/ |
| 16 |
|
| 17 |
Object.defineProperty(Object.prototype, "prop", { |
| 18 |
value: 100, |
| 19 |
writable: false, |
| 20 |
configurable: true |
| 21 |
}); |
| 22 |
var obj = { prop: 12 }; |
| 23 |
|
| 24 |
assert(obj.hasOwnProperty("prop"), 'obj.hasOwnProperty("prop") !== true'); |
| 25 |
assert.sameValue(obj.prop, 12, 'obj.prop'); |