2014-07-22 01:09:02 +02:00
|
|
|
// Copyright (c) 2012 Ecma International. All rights reserved.
|
2015-07-17 17:42:45 +02:00
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
2014-07-22 01:09:02 +02:00
|
|
|
|
|
|
|
/*---
|
2018-01-05 18:26:51 +01:00
|
|
|
info: |
|
2014-07-22 01:09:02 +02:00
|
|
|
Refer 11.1.5;
|
|
|
|
The production
|
|
|
|
PropertyNameAndValueList : PropertyNameAndValueList , PropertyAssignment
|
|
|
|
5.Call the [[DefineOwnProperty]] internal method of obj with arguments propId.name, propId.descriptor, and false.
|
2014-07-25 00:41:42 +02:00
|
|
|
es5id: 11.1.5_4-5-1
|
2014-07-22 01:09:02 +02:00
|
|
|
description: >
|
|
|
|
Object initialization using PropertyNameAndValueList
|
|
|
|
(PropertyNameAndValueList , PropertyAssignment) when property
|
|
|
|
(read-only) exists in Object.prototype (Step 5)
|
|
|
|
---*/
|
|
|
|
|
|
|
|
Object.defineProperty(Object.prototype, "prop2", {
|
|
|
|
value: 100,
|
|
|
|
writable: false,
|
|
|
|
configurable: true
|
|
|
|
});
|
|
|
|
|
|
|
|
var obj = { prop1: 101, prop2: 12 };
|
|
|
|
|
2015-08-13 17:42:52 +02:00
|
|
|
assert(obj.hasOwnProperty("prop2"), 'obj.hasOwnProperty("prop2") !== true');
|