Debian Codegraph @

rhino/testsrc/tests/ecma_3/Array/regress-322135-01.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-01.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 322135;
9 var summary = 'Array.prototype.push 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 printStatus('before array.length = ' + array.length);
23
24 try
25 {
26 array.push('Kibo');
27 }
28 catch(ex)
29 {
30 printStatus(ex.name + ': ' + ex.message);
31 }
32 reportCompare(expect, actual, summary);
33
34 //expect = 'Kibo';
35 //actual = array[length];
36 //reportCompare(expect, actual, summary + ': element appended');
37
38 //expect = length;
39 //actual = array.length;
40 //reportCompare(expect, actual, summary + ': array length unchanged');