Debian Codegraph @

rhino/testsrc/tests/ecma_3/Array/15.5.4.8-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 = '15.5.4.8-01.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 480096;
9 var summary = 'Array.lastIndexOf';
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 expect = '-12';
25 actual = 0;
26 actual += Array.lastIndexOf([2, 3,, 4, 5, 6]);
27 actual += [2, 3,, 4, 5, 6].lastIndexOf();
28 actual += Array.prototype.lastIndexOf.call([2, 3,, 4, 5, 6]);
29 actual += Array.prototype.lastIndexOf.apply([2, 3,, 4, 5, 6], [, -4]);
30 actual += Array.prototype.lastIndexOf.apply([2, 3,, 4, 5, 6], [undefined, -4]);
31 actual += Array.prototype.lastIndexOf.apply([2, 3,, 4, 5, 6], [undefined, -5]);
32 actual += Array.lastIndexOf([2, 3,, 4, 5, 6], undefined);
33 actual += Array.lastIndexOf([2, 3,, 4, 5, 6], undefined, 1);
34 actual += Array.lastIndexOf([2, 3,, 4, 5, 6], undefined, 2);
35 actual += Array.lastIndexOf([2, 3,, 4, 5, 6], undefined);
36 actual += Array.lastIndexOf([2, 3,, 4, 5, 6], undefined, 1);
37 actual += Array.lastIndexOf([2, 3,, 4, 5, 6], undefined, 2);
38
39 actual = String(actual);
40
41 reportCompare(expect, actual, summary);
42
43 exitFunc ('test');
44 }