Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/defineProperty/15.2.3.6-4-531-6.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-531-6
6 description: >
7 ES5 Attributes - Updating an indexed accessor property 'P' without
8 [[Set]] using simple assignment is failed, 'A' is an Array object
9 (8.12.5 step 5.b)
10 includes: [propertyHelper.js]
11 ---*/
12
13 var obj = [];
14
15 var verifySetFunc = "data";
16 var getFunc = function() {
17 return verifySetFunc;
18 };
19
20 Object.defineProperty(obj, "0", {
21 get: getFunc,
22 enumerable: true,
23 configurable: true
24 });
25
26 verifyNotWritable(obj, "0");
27
28 assert(obj.hasOwnProperty("0"));
29 var desc = Object.getOwnPropertyDescriptor(obj, "0");
30
31 assert.sameValue(typeof desc.set, "undefined");