Debian Codegraph @

js/src/tests/test262/built-ins/Array/S15.4.5.2_A3_T3.js

raw
1 // Copyright 2009 the Sputnik authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 info: |
6 If the length property is changed, every property whose name
7 is an array index whose value is not smaller than the new length is automatically deleted
8 es5id: 15.4.5.2_A3_T3
9 description: "[[Put]] (length, 4294967296)"
10 ---*/
11
12 var x = [];
13 x.length = 4294967295;
14 assert.sameValue(x.length, 4294967295, 'The value of x.length is expected to be 4294967295');
15
16 try {
17 x = [];
18 x.length = 4294967296;
19 throw new Test262Error('#2.1: x = []; x.length = 4294967296 throw RangeError. Actual: x.length === ' + (x.length));
20 } catch (e) {
21 assert.sameValue(
22 e instanceof RangeError,
23 true,
24 'The result of evaluating (e instanceof RangeError) is expected to be true'
25 );
26 }
27
28 reportCompare(0, 0);