Debian Codegraph @

js/src/tests/test262/language/arguments-object/mapped/nonconfigurable-nonwritable-descriptors-basic.js

raw
1 // Copyright (C) 2017 Caio Lima. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 description: Mapped arguments property descriptor change with non-configurable and non-writable property
6 info: |
7 Mapping stop working when property is set to non-writable. The
8 descriptor's value need to be the one set before the property be configured as
9 writable: false.
10 flags: [noStrict]
11 esid: sec-arguments-exotic-objects-defineownproperty-p-desc
12 includes: [propertyHelper.js]
13 ---*/
14
15 function fn(a) {
16 Object.defineProperty(arguments, "0", {configurable: false, writable: false});
17
18 // Postcondition: Arguments mapping is removed.
19 a = 2;
20
21 verifyProperty(arguments, "0", {
22 value: 1,
23 writable: false,
24 enumerable: true,
25 configurable: false,
26 });
27 }
28 fn(1);
29
30
31 reportCompare(0, 0);