Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/defineProperty/15.2.3.6-4-403.js

raw
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.6-4-403
6 description: >
7 ES5 Attributes - Successfully add a property to an object when the
8 object's prototype has a property with same name and [[Writable]]
9 attribute is set to true (Array instance)
10 ---*/
11
12 Object.defineProperty(Array.prototype, "prop", {
13 value: 1001,
14 writable: true,
15 enumerable: true,
16 configurable: true
17 });
18 var arrObj = [];
19 arrObj.prop = 1002;
20
21 assert(arrObj.hasOwnProperty("prop"), 'arrObj.hasOwnProperty("prop") !== true');
22 assert.sameValue(arrObj.prop, 1002, 'arrObj.prop');