Debian Codegraph @

rhino/testsrc/tests/ecma_3/Array/regress-322135-04.js

raw symbols SCIP
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 var gTestfile = 'regress-322135-04.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 322135;
9 var summary = 'Array.prototype.unshift on Array with length 2^32-1';
10 var actual = 'Completed';
11 var expect = 'Completed';
12
13 printBugNumber(BUGNUMBER);
14 printStatus (summary);
15
16 printStatus('This bug passes if it does not cause an out of memory error');
17 printStatus('Other issues related to array length are not tested.');
18
19 var length = 4294967295;
20 var array = new Array(length);
21
22 try
23 {
24 array.unshift('Kibo');
25 }
26 catch(ex)
27 {
28 printStatus(ex.name + ': ' + ex.message);
29 }
30 reportCompare(expect, actual, summary);
31
32 //expect = 'Kibo';
33 //actual = array[0];
34 //reportCompare(expect, actual, summary + ': first prepended');
35
36 //expect = length;
37 //actual = array.length;
38 //reportCompare(expect, actual, summary + ': array length unchanged');