Debian Codegraph @

js/src/tests/test262/built-ins/Array/of/does-not-use-set-for-indices.js

raw
1 // Copyright (C) 2020 Alexey Shvayka. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 esid: sec-array.of
6 description: >
7 Non-writable properties are overwritten by CreateDataProperty.
8 (result object's "0" is non-writable)
9 info: |
10 Array.of ( ...items )
11
12 [...]
13 7. Repeat, while k < len
14 [...]
15 c. Perform ? CreateDataPropertyOrThrow(A, Pk, kValue).
16 [...]
17 includes: [propertyHelper.js]
18 ---*/
19
20 var A = function(_length) {
21 Object.defineProperty(this, "0", {
22 value: 1,
23 writable: false,
24 enumerable: false,
25 configurable: true,
26 });
27 };
28
29 var res = Array.of.call(A, 2);
30
31 verifyProperty(res, "0", {
32 value: 2,
33 writable: true,
34 enumerable: true,
35 configurable: true,
36 });
37
38 reportCompare(0, 0);