]>
git.saurik.com Git - apple/javascriptcore.git/blob - tests/mozilla/js1_2/regress/regress-7703.js
2 * The contents of this file are subject to the Netscape Public
3 * License Version 1.1 (the "License"); you may not use this file
4 * except in compliance with the License. You may obtain a copy of
5 * the License at http://www.mozilla.org/NPL/
7 * Software distributed under the License is distributed on an "AS
8 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
9 * implied. See the License for the specific language governing
10 * rights and limitations under the License.
12 * The Original Code is mozilla.org code.
14 * The Initial Developer of the Original Code is Netscape
15 * Communications Corporation. Portions created by Netscape are
16 * Copyright (C) 1998 Netscape Communications Corporation. All
23 * File Name: regress-7703.js
24 * Reference: "http://bugzilla.mozilla.org/show_bug.cgi?id=7703";
25 * Description: See the text of the bugnumber above
28 var SECTION
= "js1_2"; // provide a document reference (ie, ECMA section)
29 var VERSION
= "JS1_2"; // Version of JavaScript or ECMA
30 var TITLE
= "Regression test for bugzilla # 7703"; // Provide ECMA section title or a description
31 var BUGNUMBER
= "http://bugzilla.mozilla.org/show_bug.cgi?id=7703"; // Provide URL to bugsplat or bugzilla report
33 startTest(); // leave this alone
36 * Calls to AddTestCase here. AddTestCase is a function that is defined
37 * in shell.js and takes three arguments:
38 * - a string representation of what is being tested
39 * - the expected result
42 * For example, a test might look like this:
44 * var zip = /[\d]{5}$/;
47 * "zip = /[\d]{5}$/; \"PO Box 12345 Boston, MA 02134\".match(zip)", // description of the test
48 * "02134", // expected result
49 * "PO Box 12345 Boston, MA 02134".match(zip) ); // actual result
54 function inspect(object
) {
55 for (prop
in object
) {
57 types
[types
.length
] = (typeof x
);
64 AddTestCase( "inspect(o),length", 2, types
.length
);
65 AddTestCase( "inspect(o)[0]", "number", types
[0] );
66 AddTestCase( "inspect(o)[1]", "number", types
[1] );
70 function inspect_again(object
) {
71 for (prop
in object
) {
72 types_2
[types_2
.length
] = (typeof object
[prop
]);
77 AddTestCase( "inspect_again(o),length", 2, types
.length
);
78 AddTestCase( "inspect_again(o)[0]", "number", types
[0] );
79 AddTestCase( "inspect_again(o)[1]", "number", types
[1] );
82 test(); // leave this alone. this executes the test cases and