Debian Codegraph @

js/src/tests/test262/language/arguments-object/mapped/nonwritable-nonenumerable-nonconfigurable-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 to non-writable and non-configurable
6 info: |
7 Change the descriptor using [[DefineOwnProperty]] to
8 {writable: false, enumerable: false} and then
9 change property descriptor to {configurable: false}.
10 The descriptor's enumerable property continue with its configured value
11 even if mapping stops.
12 flags: [noStrict]
13 esid: sec-arguments-exotic-objects-defineownproperty-p-desc
14 includes: [propertyHelper.js]
15 ---*/
16
17 function fn(a) {
18 Object.defineProperty(arguments, "0", {writable: false, enumerable: false});
19 Object.defineProperty(arguments, "0", {configurable: false});
20
21 verifyProperty(arguments, "0", {
22 value: 1,
23 writable: false,
24 enumerable: false,
25 configurable: false,
26 });
27
28 // Postcondition: Arguments mapping is removed.
29 a = 2;
30
31 verifyProperty(arguments, "0", {
32 value: 1,
33 writable: false,
34 enumerable: false,
35 configurable: false,
36 });
37 }
38 fn(1);
39
40 reportCompare(0, 0);