Debian Codegraph @

rhino/testsrc/jstests/778549.jstest

raw
1 // This Source Code Form is subject to the terms of the Mozilla Public
2 // License, v. 2.0. If a copy of the MPL was not distributed with this
3 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
4
5 // https://bugzilla.mozilla.org/show_bug.cgi?id=778549
6
7 function assertSame(expected, actual) {
8 if (expected !== actual) {
9 throw "Expected '" + expected + "' but was '" + actual + "'";
10 }
11 }
12
13 function assertTrue(actual) {
14 assertSame(true, actual);
15 }
16
17 function assertFalse(actual) {
18 assertSame(false, actual);
19 }
20
21
22 var array = ['a',,void 0];
23
24 assertSame(3, array.length);
25 assertTrue(array.hasOwnProperty('0'));
26 assertFalse(array.hasOwnProperty('1'));
27 assertTrue(array.hasOwnProperty('2'));
28
29 array.sort();
30
31 assertSame(3, array.length);
32 assertTrue(array.hasOwnProperty('0'));
33 assertTrue(array.hasOwnProperty('1'));
34 assertFalse(array.hasOwnProperty('2'));
35
36 "success";