Debian Codegraph @

js/src/tests/test262/language/arguments-object/10.6-11-b-1.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: 10.6-11-b-1
6 description: >
7 Arguments Object has index property '0' as its own property, it
8 shoulde be writable, enumerable, configurable and does not invoke
9 the setter defined on Object.prototype[0] (Step 11.b)
10 includes: [propertyHelper.js]
11 ---*/
12
13 var data = "data";
14 var getFunc = function () {
15 return data;
16 };
17
18 var setFunc = function (value) {
19 data = value;
20 };
21
22 Object.defineProperty(Object.prototype, "0", {
23 get: getFunc,
24 set: setFunc,
25 configurable: true
26 });
27
28 var argObj = (function () { return arguments })(1);
29
30 verifyProperty(argObj, "0", {
31 value: 1,
32 writable: true,
33 enumerable: true,
34 configurable: true,
35 });
36
37 assert.sameValue(data, "data", 'data');
38
39 reportCompare(0, 0);