Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/defineProperty/15.2.3.6-4-325.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-325
6 description: >
7 Object.defineProperty - 'O' is an Arguments object, 'name' is own
8 property of [[ParameterMap]] of 'O', test 'name' is deleted if
9 'name' is configurable and 'desc' is accessor descriptor (10.6
10 [[DefineOwnProperty]] step 5.a.i)
11 ---*/
12
13 var argObj = (function() {
14 return arguments;
15 })(1, 2, 3);
16 var accessed = false;
17
18 Object.defineProperty(argObj, 0, {
19 get: function() {
20 accessed = true;
21 return 12;
22 }
23 });
24
25 assert.sameValue(argObj[0], 12, 'argObj[0]');
26 assert(accessed, 'accessed !== true');