Debian Codegraph @

rhino/testsrc/tests/ecma_3/Regress/regress-419152.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-419152.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 419152;
9 var summary = 'Shaver can not contain himself';
10 var actual = '';
11 var expect = '';
12
13
14 //-----------------------------------------------------------------------------
15 test();
16 //-----------------------------------------------------------------------------
17
18 function test()
19 {
20 enterFunc ('test');
21 printBugNumber(BUGNUMBER);
22 printStatus (summary);
23
24 var a = [1,2,3];
25
26 a[5] = 6;
27 expect = '1,2,3,,,6:6';
28 actual = a + ':' + a.length;
29 reportCompare(expect, actual, summary + ': 1');
30
31 a = [1,2,3,4];
32 expect = 'undefined';
33 actual = a[-1] + '';
34 reportCompare(expect, actual, summary + ': 2');
35
36 a = [1,2,3];
37 a[-1] = 55;
38
39 expect = 3;
40 actual = a.length;
41 reportCompare(expect, actual, summary + ': 3');
42
43 expect = '1,2,3';
44 actual = a + '';
45 reportCompare(expect, actual, summary + ': 4');
46
47 expect = 55;
48 actual = a[-1];
49 reportCompare(expect, actual, summary + ': 5');
50
51 var s = "abcdef";
52
53 expect = 'undefined';
54 actual = s[-2] + '';
55 reportCompare(expect, actual, summary + ': 6');
56
57 exitFunc ('test');
58 }