Debian Codegraph @

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