michael@0: // |reftest| skip -- obsolete test michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: michael@0: /** michael@0: File Name: tostring_1.js michael@0: ECMA Section: Array.toString() michael@0: Description: michael@0: michael@0: This checks the ToString value of Array objects under JavaScript 1.2. michael@0: michael@0: Author: christine@netscape.com michael@0: Date: 12 november 1997 michael@0: */ michael@0: michael@0: var SECTION = "JS1_2"; michael@0: var VERSION = "JS1_2"; michael@0: startTest(); michael@0: var TITLE = "Array.toString()"; michael@0: michael@0: writeHeaderToLog( SECTION + " "+ TITLE); michael@0: michael@0: var a = new Array(); michael@0: michael@0: var VERSION = 0; michael@0: michael@0: if ( version() == 120 ) { michael@0: VERSION = "120"; michael@0: } else { michael@0: VERSION = ""; michael@0: } michael@0: michael@0: new TestCase ( SECTION, michael@0: "var a = new Array(); a.toString()", michael@0: ( VERSION == "120" ? "[]" : "" ), michael@0: a.toString() ); michael@0: michael@0: a[0] = void 0; michael@0: michael@0: new TestCase ( SECTION, michael@0: "a[0] = void 0; a.toString()", michael@0: ( VERSION == "120" ? "[, ]" : "" ), michael@0: a.toString() ); michael@0: michael@0: michael@0: new TestCase( SECTION, michael@0: "a.length", michael@0: 1, michael@0: a.length ); michael@0: michael@0: a[1] = void 0; michael@0: michael@0: new TestCase( SECTION, michael@0: "a[1] = void 0; a.toString()", michael@0: ( VERSION == "120" ? "[, , ]" : "," ), michael@0: a.toString() ); michael@0: michael@0: a[1] = "hi"; michael@0: michael@0: new TestCase( SECTION, michael@0: "a[1] = \"hi\"; a.toString()", michael@0: ( VERSION == "120" ? "[, \"hi\"]" : ",hi" ), michael@0: a.toString() ); michael@0: michael@0: a[2] = void 0; michael@0: michael@0: new TestCase( SECTION, michael@0: "a[2] = void 0; a.toString()", michael@0: ( VERSION == "120" ?"[, \"hi\", , ]":",hi,"), michael@0: a.toString() ); michael@0: michael@0: var b = new Array(1000); michael@0: var bstring = ""; michael@0: for ( blen=0; blen<999; blen++) { michael@0: bstring += ","; michael@0: } michael@0: michael@0: michael@0: new TestCase ( SECTION, michael@0: "var b = new Array(1000); b.toString()", michael@0: ( VERSION == "120" ? "[1000]" : bstring ), michael@0: b.toString() ); michael@0: michael@0: michael@0: new TestCase( SECTION, michael@0: "b.length", michael@0: ( VERSION == "120" ? 1 : 1000 ), michael@0: b.length ); michael@0: michael@0: test();