summaryrefslogtreecommitdiffstats
path: root/JavaScriptCore/tests/mozilla/ecma/Array
diff options
context:
space:
mode:
Diffstat (limited to 'JavaScriptCore/tests/mozilla/ecma/Array')
-rw-r--r--JavaScriptCore/tests/mozilla/ecma/Array/15.4-1.js126
-rw-r--r--JavaScriptCore/tests/mozilla/ecma/Array/15.4-2.js83
-rw-r--r--JavaScriptCore/tests/mozilla/ecma/Array/15.4.1.1.js88
-rw-r--r--JavaScriptCore/tests/mozilla/ecma/Array/15.4.1.2.js98
-rw-r--r--JavaScriptCore/tests/mozilla/ecma/Array/15.4.1.3.js86
-rw-r--r--JavaScriptCore/tests/mozilla/ecma/Array/15.4.1.js133
-rw-r--r--JavaScriptCore/tests/mozilla/ecma/Array/15.4.2.1-1.js92
-rw-r--r--JavaScriptCore/tests/mozilla/ecma/Array/15.4.2.1-2.js83
-rw-r--r--JavaScriptCore/tests/mozilla/ecma/Array/15.4.2.1-3.js112
-rw-r--r--JavaScriptCore/tests/mozilla/ecma/Array/15.4.2.2-1.js124
-rw-r--r--JavaScriptCore/tests/mozilla/ecma/Array/15.4.2.2-2.js89
-rw-r--r--JavaScriptCore/tests/mozilla/ecma/Array/15.4.2.3.js74
-rw-r--r--JavaScriptCore/tests/mozilla/ecma/Array/15.4.3.1-2.js66
-rw-r--r--JavaScriptCore/tests/mozilla/ecma/Array/15.4.3.2.js57
-rw-r--r--JavaScriptCore/tests/mozilla/ecma/Array/15.4.3.js63
-rw-r--r--JavaScriptCore/tests/mozilla/ecma/Array/15.4.4.1.js57
-rw-r--r--JavaScriptCore/tests/mozilla/ecma/Array/15.4.4.2.js83
-rw-r--r--JavaScriptCore/tests/mozilla/ecma/Array/15.4.4.3-1.js159
-rw-r--r--JavaScriptCore/tests/mozilla/ecma/Array/15.4.4.4-1.js272
-rw-r--r--JavaScriptCore/tests/mozilla/ecma/Array/15.4.4.4-2.js163
-rw-r--r--JavaScriptCore/tests/mozilla/ecma/Array/15.4.4.5-1.js223
-rw-r--r--JavaScriptCore/tests/mozilla/ecma/Array/15.4.4.5-2.js224
-rw-r--r--JavaScriptCore/tests/mozilla/ecma/Array/15.4.4.5-3.js181
-rw-r--r--JavaScriptCore/tests/mozilla/ecma/Array/15.4.4.js77
-rw-r--r--JavaScriptCore/tests/mozilla/ecma/Array/15.4.5.1-1.js172
-rw-r--r--JavaScriptCore/tests/mozilla/ecma/Array/15.4.5.1-2.js150
-rw-r--r--JavaScriptCore/tests/mozilla/ecma/Array/15.4.5.2-1.js93
-rw-r--r--JavaScriptCore/tests/mozilla/ecma/Array/15.4.5.2-2.js123
28 files changed, 0 insertions, 3351 deletions
diff --git a/JavaScriptCore/tests/mozilla/ecma/Array/15.4-1.js b/JavaScriptCore/tests/mozilla/ecma/Array/15.4-1.js
deleted file mode 100644
index c5c3178..0000000
--- a/JavaScriptCore/tests/mozilla/ecma/Array/15.4-1.js
+++ /dev/null
@@ -1,126 +0,0 @@
-/* The contents of this file are subject to the Netscape Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/NPL/
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * The Original Code is Mozilla Communicator client code, released March
- * 31, 1998.
- *
- * The Initial Developer of the Original Code is Netscape Communications
- * Corporation. Portions created by Netscape are
- * Copyright (C) 1998 Netscape Communications Corporation. All
- * Rights Reserved.
- *
- * Contributor(s):
- *
- */
-/**
- File Name: 15.4-1.js
- ECMA Section: 15.4 Array Objects
-
- Description: Every Array object has a length property whose value
- is always an integer with positive sign and less than
- Math.pow(2,32).
-
- Author: christine@netscape.com
- Date: 28 october 1997
-
-*/
- var SECTION = "15.4-1";
- var VERSION = "ECMA_1";
- startTest();
- var TITLE = "Array Objects";
-
- writeHeaderToLog( SECTION + " "+ TITLE);
-
- var testcases = getTestCases();
- test();
-
-function getTestCases() {
- var array = new Array();
- var item = 0;
-
- array[item++] = new TestCase( SECTION,
- "var myarr = new Array(); myarr[Math.pow(2,32)-2]='hi'; myarr[Math.pow(2,32)-2]",
- "hi",
- eval("var myarr = new Array(); myarr[Math.pow(2,32)-2]='hi'; myarr[Math.pow(2,32)-2]")
- );
- array[item++] = new TestCase( SECTION,
- "var myarr = new Array(); myarr[Math.pow(2,32)-2]='hi'; myarr.length",
- (Math.pow(2,32)-1),
- eval("var myarr = new Array(); myarr[Math.pow(2,32)-2]='hi'; myarr.length")
- );
- array[item++] = new TestCase( SECTION,
- "var myarr = new Array(); myarr[Math.pow(2,32)-3]='hi'; myarr[Math.pow(2,32)-3]",
- "hi",
- eval("var myarr = new Array(); myarr[Math.pow(2,32)-3]='hi'; myarr[Math.pow(2,32)-3]")
- );
- array[item++] = new TestCase( SECTION,
- "var myarr = new Array(); myarr[Math.pow(2,32)-3]='hi'; myarr.length",
- (Math.pow(2,32)-2),
- eval("var myarr = new Array(); myarr[Math.pow(2,32)-3]='hi'; myarr.length")
- );
-
- array[item++] = new TestCase( SECTION,
- "var myarr = new Array(); myarr[Math.pow(2,31)-2]='hi'; myarr[Math.pow(2,31)-2]",
- "hi",
- eval("var myarr = new Array(); myarr[Math.pow(2,31)-2]='hi'; myarr[Math.pow(2,31)-2]")
- );
- array[item++] = new TestCase( SECTION,
- "var myarr = new Array(); myarr[Math.pow(2,31)-2]='hi'; myarr.length",
- (Math.pow(2,31)-1),
- eval("var myarr = new Array(); myarr[Math.pow(2,31)-2]='hi'; myarr.length")
- );
-
- array[item++] = new TestCase( SECTION,
- "var myarr = new Array(); myarr[Math.pow(2,31)-1]='hi'; myarr[Math.pow(2,31)-1]",
- "hi",
- eval("var myarr = new Array(); myarr[Math.pow(2,31)-1]='hi'; myarr[Math.pow(2,31)-1]")
- );
- array[item++] = new TestCase( SECTION,
- "var myarr = new Array(); myarr[Math.pow(2,31)-1]='hi'; myarr.length",
- (Math.pow(2,31)),
- eval("var myarr = new Array(); myarr[Math.pow(2,31)-1]='hi'; myarr.length")
- );
-
-
- array[item++] = new TestCase( SECTION,
- "var myarr = new Array(); myarr[Math.pow(2,31)]='hi'; myarr[Math.pow(2,31)]",
- "hi",
- eval("var myarr = new Array(); myarr[Math.pow(2,31)]='hi'; myarr[Math.pow(2,31)]")
- );
- array[item++] = new TestCase( SECTION,
- "var myarr = new Array(); myarr[Math.pow(2,31)]='hi'; myarr.length",
- (Math.pow(2,31)+1),
- eval("var myarr = new Array(); myarr[Math.pow(2,31)]='hi'; myarr.length")
- );
-
- array[item++] = new TestCase( SECTION,
- "var myarr = new Array(); myarr[Math.pow(2,30)-2]='hi'; myarr[Math.pow(2,30)-2]",
- "hi",
- eval("var myarr = new Array(); myarr[Math.pow(2,30)-2]='hi'; myarr[Math.pow(2,30)-2]")
- );
- array[item++] = new TestCase( SECTION,
- "var myarr = new Array(); myarr[Math.pow(2,30)-2]='hi'; myarr.length",
- (Math.pow(2,30)-1),
- eval("var myarr = new Array(); myarr[Math.pow(2,30)-2]='hi'; myarr.length")
- );
- return ( array );
-}
-function test() {
- for ( tc=0; tc < testcases.length; tc++ ) {
- testcases[tc].passed = writeTestCaseResult(
- testcases[tc].expect,
- testcases[tc].actual,
- testcases[tc].description +" = "+ testcases[tc].actual );
-
- testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
- }
- stopTest();
- return ( testcases );
-}
diff --git a/JavaScriptCore/tests/mozilla/ecma/Array/15.4-2.js b/JavaScriptCore/tests/mozilla/ecma/Array/15.4-2.js
deleted file mode 100644
index ca046e6..0000000
--- a/JavaScriptCore/tests/mozilla/ecma/Array/15.4-2.js
+++ /dev/null
@@ -1,83 +0,0 @@
-/* The contents of this file are subject to the Netscape Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/NPL/
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * The Original Code is Mozilla Communicator client code, released March
- * 31, 1998.
- *
- * The Initial Developer of the Original Code is Netscape Communications
- * Corporation. Portions created by Netscape are
- * Copyright (C) 1998 Netscape Communications Corporation. All
- * Rights Reserved.
- *
- * Contributor(s):
- *
- */
-/**
- File Name: 15.4-2.js
- ECMA Section: 15.4 Array Objects
-
- Description: Whenever a property is added whose name is an array
- index, the length property is changed, if necessary,
- to be one more than the numeric value of that array
- index; and whenever the length property is changed,
- every property whose name is an array index whose value
- is not smaller than the new length is automatically
- deleted. This constraint applies only to the Array
- object itself, and is unaffected by length or array
- index properties that may be inherited from its
- prototype.
-
- Author: christine@netscape.com
- Date: 28 october 1997
-
-*/
- var SECTION = "15.4-2";
- var VERSION = "ECMA_1";
- startTest();
- var TITLE = "Array Objects";
-
- writeHeaderToLog( SECTION + " "+ TITLE);
-
- var testcases = getTestCases();
- test();
-
-function getTestCases() {
- var array = new Array();
- var item = 0;
-
- array[item++] = new TestCase( SECTION, "var arr=new Array(); arr[Math.pow(2,16)] = 'hi'; arr.length", Math.pow(2,16)+1, eval("var arr=new Array(); arr[Math.pow(2,16)] = 'hi'; arr.length") );
-
- array[item++] = new TestCase( SECTION, "var arr=new Array(); arr[Math.pow(2,30)-2] = 'hi'; arr.length", Math.pow(2,30)-1, eval("var arr=new Array(); arr[Math.pow(2,30)-2] = 'hi'; arr.length") );
- array[item++] = new TestCase( SECTION, "var arr=new Array(); arr[Math.pow(2,30)-1] = 'hi'; arr.length", Math.pow(2,30), eval("var arr=new Array(); arr[Math.pow(2,30)-1] = 'hi'; arr.length") );
- array[item++] = new TestCase( SECTION, "var arr=new Array(); arr[Math.pow(2,30)] = 'hi'; arr.length", Math.pow(2,30)+1, eval("var arr=new Array(); arr[Math.pow(2,30)] = 'hi'; arr.length") );
-
- array[item++] = new TestCase( SECTION, "var arr=new Array(); arr[Math.pow(2,31)-2] = 'hi'; arr.length", Math.pow(2,31)-1, eval("var arr=new Array(); arr[Math.pow(2,31)-2] = 'hi'; arr.length") );
- array[item++] = new TestCase( SECTION, "var arr=new Array(); arr[Math.pow(2,31)-1] = 'hi'; arr.length", Math.pow(2,31), eval("var arr=new Array(); arr[Math.pow(2,31)-1] = 'hi'; arr.length") );
- array[item++] = new TestCase( SECTION, "var arr=new Array(); arr[Math.pow(2,31)] = 'hi'; arr.length", Math.pow(2,31)+1, eval("var arr=new Array(); arr[Math.pow(2,31)] = 'hi'; arr.length") );
-
- array[item++] = new TestCase( SECTION, "var arr = new Array(0,1,2,3,4,5); arr.length = 2; String(arr)", "0,1", eval("var arr = new Array(0,1,2,3,4,5); arr.length = 2; String(arr)") );
- array[item++] = new TestCase( SECTION, "var arr = new Array(0,1); arr.length = 3; String(arr)", "0,1,", eval("var arr = new Array(0,1); arr.length = 3; String(arr)") );
-// array[item++] = new TestCase( SECTION, "var arr = new Array(0,1,2,3,4,5); delete arr[0]; arr.length", 5, eval("var arr = new Array(0,1,2,3,4,5); delete arr[0]; arr.length") );
-// array[item++] = new TestCase( SECTION, "var arr = new Array(0,1,2,3,4,5); delete arr[6]; arr.length", 5, eval("var arr = new Array(0,1,2,3,4,5); delete arr[6]; arr.length") );
-
- return ( array );
-}
-function test( array ) {
- for ( tc=0; tc < testcases.length; tc++ ) {
- testcases[tc].passed = writeTestCaseResult(
- testcases[tc].expect,
- testcases[tc].actual,
- testcases[tc].description +" = "+ testcases[tc].actual );
-
- testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
- }
- stopTest();
- return ( testcases );
-}
diff --git a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.1.1.js b/JavaScriptCore/tests/mozilla/ecma/Array/15.4.1.1.js
deleted file mode 100644
index 315aa2c..0000000
--- a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.1.1.js
+++ /dev/null
@@ -1,88 +0,0 @@
-/* The contents of this file are subject to the Netscape Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/NPL/
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * The Original Code is Mozilla Communicator client code, released March
- * 31, 1998.
- *
- * The Initial Developer of the Original Code is Netscape Communications
- * Corporation. Portions created by Netscape are
- * Copyright (C) 1998 Netscape Communications Corporation. All
- * Rights Reserved.
- *
- * Contributor(s):
- *
- */
-/**
- File Name: 15.4.1.1.js
- ECMA Section: 15.4.1 Array( item0, item1,... )
-
- Description: When Array is called as a function rather than as a
- constructor, it creates and initializes a new array
- object. Thus, the function call Array(...) is
- equivalent to the object creation new Array(...) with
- the same arguments.
-
- An array is created and returned as if by the expression
- new Array( item0, item1, ... ).
-
- Author: christine@netscape.com
- Date: 7 october 1997
-*/
- var SECTION = "15.4.1.1";
- var VERSION = "ECMA_1";
- startTest();
- var TITLE = "Array Constructor Called as a Function";
-
- writeHeaderToLog( SECTION + " "+ TITLE);
-
- var testcases = getTestCases();
- test();
-
-function ToUint32( n ) {
- n = Number( n );
- if( isNaN(n) || n == 0 || n == Number.POSITIVE_INFINITY ||
- n == Number.NEGATIVE_INFINITY ) {
- return 0;
- }
- var sign = n < 0 ? -1 : 1;
-
- return ( sign * ( n * Math.floor( Math.abs(n) ) ) ) % Math.pow(2, 32);
-}
-
-function getTestCases() {
- var array = new Array();
- var item = 0;
-
- array[item++] = new TestCase( SECTION, "typeof Array(1,2)", "object", typeof Array(1,2) );
- array[item++] = new TestCase( SECTION, "(Array(1,2)).toString", Array.prototype.toString, (Array(1,2)).toString );
- array[item++] = new TestCase( SECTION,
- "var arr = Array(1,2,3); arr.toString = Object.prototype.toString; arr.toString()",
- "[object Array]",
- eval("var arr = Array(1,2,3); arr.toString = Object.prototype.toString; arr.toString()") );
-
-
- array[item++] = new TestCase( SECTION, "(Array(1,2)).length", 2, (Array(1,2)).length );
- array[item++] = new TestCase( SECTION, "var arr = (Array(1,2)); arr[0]", 1, eval("var arr = (Array(1,2)); arr[0]") );
- array[item++] = new TestCase( SECTION, "var arr = (Array(1,2)); arr[1]", 2, eval("var arr = (Array(1,2)); arr[1]") );
- array[item++] = new TestCase( SECTION, "var arr = (Array(1,2)); String(arr)", "1,2", eval("var arr = (Array(1,2)); String(arr)") );
-
- return ( array );
-}
-function test() {
- for ( tc=0; tc < testcases.length; tc++ ) {
- testcases[tc].passed = writeTestCaseResult(
- testcases[tc].expect,
- testcases[tc].actual,
- testcases[tc].description +" = "+ testcases[tc].actual );
- testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
- }
- stopTest();
- return ( testcases );
-}
diff --git a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.1.2.js b/JavaScriptCore/tests/mozilla/ecma/Array/15.4.1.2.js
deleted file mode 100644
index 29352e1..0000000
--- a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.1.2.js
+++ /dev/null
@@ -1,98 +0,0 @@
-/* The contents of this file are subject to the Netscape Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/NPL/
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * The Original Code is Mozilla Communicator client code, released March
- * 31, 1998.
- *
- * The Initial Developer of the Original Code is Netscape Communications
- * Corporation. Portions created by Netscape are
- * Copyright (C) 1998 Netscape Communications Corporation. All
- * Rights Reserved.
- *
- * Contributor(s):
- *
- */
-/**
- File Name: 15.4.1.2.js
- ECMA Section: 15.4.1.2 Array(len)
-
- Description: When Array is called as a function rather than as a
- constructor, it creates and initializes a new array
- object. Thus, the function call Array(...) is
- equivalent to the object creationi new Array(...) with
- the same arguments.
-
- An array is created and returned as if by the
- expression new Array(len).
-
- Author: christine@netscape.com
- Date: 7 october 1997
-*/
- var SECTION = "15.4.1.2";
- var VERSION = "ECMA_1";
- startTest();
- var TITLE = "Array Constructor Called as a Function: Array(len)";
-
- writeHeaderToLog( SECTION + " "+ TITLE);
-
- var testcases = getTestCases();
- test();
-
-function getTestCases() {
- var array = new Array();
- var item = 0;
-
- array[item++] = new TestCase( SECTION, "(Array()).length", 0, (Array()).length );
- array[item++] = new TestCase( SECTION, "(Array(0)).length", 0, (Array(0)).length );
- array[item++] = new TestCase( SECTION, "(Array(1)).length", 1, (Array(1)).length );
- array[item++] = new TestCase( SECTION, "(Array(10)).length", 10, (Array(10)).length );
- array[item++] = new TestCase( SECTION, "(Array('1')).length", 1, (Array('1')).length );
- array[item++] = new TestCase( SECTION, "(Array(1000)).length", 1000, (Array(1000)).length );
- array[item++] = new TestCase( SECTION, "(Array('1000')).length", 1, (Array('1000')).length );
- array[item++] = new TestCase( SECTION, "(Array(4294967295)).length", ToUint32(4294967295), (Array(4294967295)).length );
- array[item++] = new TestCase( SECTION, "(Array(Math.pow(2,31)-1)).length", ToUint32(Math.pow(2,31)-1), (Array(Math.pow(2,31)-1)).length );
- array[item++] = new TestCase( SECTION, "(Array(Math.pow(2,31))).length", ToUint32(Math.pow(2,31)), (Array(Math.pow(2,31))).length );
- array[item++] = new TestCase( SECTION, "(Array(Math.pow(2,31)+1)).length", ToUint32(Math.pow(2,31)+1), (Array(Math.pow(2,31)+1)).length );
- array[item++] = new TestCase( SECTION, "(Array('8589934592')).length", 1, (Array("8589934592")).length );
- array[item++] = new TestCase( SECTION, "(Array('4294967296')).length", 1, (Array("4294967296")).length );
- array[item++] = new TestCase( SECTION, "(Array(1073741823)).length", ToUint32(1073741823), (Array(1073741823)).length );
- array[item++] = new TestCase( SECTION, "(Array(1073741824)).length", ToUint32(1073741824), (Array(1073741824)).length );
- array[item++] = new TestCase( SECTION, "(Array('a string')).length", 1, (Array("a string")).length );
-
- return ( array );
-}
-function test() {
- for ( tc=0; tc < testcases.length; tc++ ) {
- testcases[tc].passed = writeTestCaseResult(
- testcases[tc].expect,
- testcases[tc].actual,
- testcases[tc].description +" = "+ testcases[tc].actual );
- testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
- }
- stopTest();
- return ( testcases );
-}
-function ToUint32( n ) {
- n = Number( n );
- var sign = ( n < 0 ) ? -1 : 1;
-
- if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) {
- return 0;
- }
- n = sign * Math.floor( Math.abs(n) )
-
- n = n % Math.pow(2,32);
-
- if ( n < 0 ){
- n += Math.pow(2,32);
- }
-
- return ( n );
-} \ No newline at end of file
diff --git a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.1.3.js b/JavaScriptCore/tests/mozilla/ecma/Array/15.4.1.3.js
deleted file mode 100644
index 4c3393e..0000000
--- a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.1.3.js
+++ /dev/null
@@ -1,86 +0,0 @@
-/* The contents of this file are subject to the Netscape Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/NPL/
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * The Original Code is Mozilla Communicator client code, released March
- * 31, 1998.
- *
- * The Initial Developer of the Original Code is Netscape Communications
- * Corporation. Portions created by Netscape are
- * Copyright (C) 1998 Netscape Communications Corporation. All
- * Rights Reserved.
- *
- * Contributor(s):
- *
- */
-/**
- File Name: 15.4.1.3.js
- ECMA Section: 15.4.1.3 Array()
-
- Description: When Array is called as a function rather than as a
- constructor, it creates and initializes a new array
- object. Thus, the function call Array(...) is
- equivalent to the object creationi new Array(...) with
- the same arguments.
-
- An array is created and returned as if by the
- expression new Array(len).
-
- Author: christine@netscape.com
- Date: 7 october 1997
-*/
- var SECTION = "15.4.1.3";
- var VERSION = "ECMA_1";
- startTest();
- var TITLE = "Array Constructor Called as a Function: Array()";
-
- writeHeaderToLog( SECTION + " "+ TITLE);
-
- var testcases = getTestCases();
- test();
-
-
-function getTestCases() {
- var array = new Array();
- var item = 0;
-
- array[item++] = new TestCase( SECTION,
- "typeof Array()",
- "object",
- typeof Array() );
-
- array[item++] = new TestCase( SECTION,
- "MYARR = new Array();MYARR.getClass = Object.prototype.toString;MYARR.getClass()",
- "[object Array]",
- eval("MYARR = Array();MYARR.getClass = Object.prototype.toString;MYARR.getClass()") );
-
- array[item++] = new TestCase( SECTION,
- "(Array()).length",
- 0, (
- Array()).length );
-
- array[item++] = new TestCase( SECTION,
- "Array().toString()",
- "",
- Array().toString() );
-
-
- return ( array );
-}
-function test() {
- for ( tc=0; tc < testcases.length; tc++ ) {
- testcases[tc].passed = writeTestCaseResult(
- testcases[tc].expect,
- testcases[tc].actual,
- testcases[tc].description +" = "+ testcases[tc].actual );
- testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
- }
- stopTest();
- return ( testcases );
-}
diff --git a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.1.js b/JavaScriptCore/tests/mozilla/ecma/Array/15.4.1.js
deleted file mode 100644
index 5640584..0000000
--- a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.1.js
+++ /dev/null
@@ -1,133 +0,0 @@
-/* The contents of this file are subject to the Netscape Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/NPL/
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * The Original Code is Mozilla Communicator client code, released March
- * 31, 1998.
- *
- * The Initial Developer of the Original Code is Netscape Communications
- * Corporation. Portions created by Netscape are
- * Copyright (C) 1998 Netscape Communications Corporation. All
- * Rights Reserved.
- *
- * Contributor(s):
- *
- */
-/**
- File Name: 15.4.1.js
- ECMA Section: 15.4.1 The Array Constructor Called as a Function
-
- Description: When Array is called as a function rather than as a
- constructor, it creates and initializes a new array
- object. Thus, the function call Array(...) is
- equivalent to the object creationi new Array(...) with
- the same arguments.
-
- Author: christine@netscape.com
- Date: 7 october 1997
-*/
-
- var SECTION = "15.4.1";
- var VERSION = "ECMA_1";
- startTest();
- var TITLE = "The Array Constructor Called as a Function";
-
- writeHeaderToLog( SECTION + " "+ TITLE);
-
- var testcases = getTestCases();
- test();
-
-function getTestCases() {
- var array = new Array();
- var item = 0;
-
- array[item++] = new TestCase( SECTION,
- "Array() +''",
- "",
- Array() +"" );
-
- array[item++] = new TestCase( SECTION,
- "typeof Array()",
- "object",
- typeof Array() );
-
- array[item++] = new TestCase( SECTION,
- "var arr = Array(); arr.getClass = Object.prototype.toString; arr.getClass()",
- "[object Array]",
- eval("var arr = Array(); arr.getClass = Object.prototype.toString; arr.getClass()") );
-
- array[item++] = new TestCase( SECTION,
- "var arr = Array(); arr.toString == Array.prototype.toString",
- true,
- eval("var arr = Array(); arr.toString == Array.prototype.toString") );
-
- array[item++] = new TestCase( SECTION,
- "Array().length",
- 0,
- Array().length );
-
-
- array[item++] = new TestCase( SECTION,
- "Array(1,2,3) +''",
- "1,2,3",
- Array(1,2,3) +"" );
-
- array[item++] = new TestCase( SECTION,
- "typeof Array(1,2,3)",
- "object",
- typeof Array(1,2,3) );
-
- array[item++] = new TestCase( SECTION,
- "var arr = Array(1,2,3); arr.getClass = Object.prototype.toString; arr.getClass()",
- "[object Array]",
- eval("var arr = Array(1,2,3); arr.getClass = Object.prototype.toString; arr.getClass()") );
-
- array[item++] = new TestCase( SECTION,
- "var arr = Array(1,2,3); arr.toString == Array.prototype.toString",
- true,
- eval("var arr = Array(1,2,3); arr.toString == Array.prototype.toString") );
-
- array[item++] = new TestCase( SECTION,
- "Array(1,2,3).length",
- 3,
- Array(1,2,3).length );
-
- array[item++] = new TestCase( SECTION,
- "typeof Array(12345)",
- "object",
- typeof Array(12345) );
-
- array[item++] = new TestCase( SECTION,
- "var arr = Array(12345); arr.getClass = Object.prototype.toString; arr.getClass()",
- "[object Array]",
- eval("var arr = Array(12345); arr.getClass = Object.prototype.toString; arr.getClass()") );
-
- array[item++] = new TestCase( SECTION,
- "var arr = Array(1,2,3,4,5); arr.toString == Array.prototype.toString",
- true,
- eval("var arr = Array(1,2,3,4,5); arr.toString == Array.prototype.toString") );
-
- array[item++] = new TestCase( SECTION,
- "Array(12345).length",
- 12345,
- Array(12345).length );
-
- return ( array );
-}
-function test() {
- for (tc=0 ; tc < testcases.length; tc++ ) {
- testcases[tc].passed = writeTestCaseResult(
- testcases[tc].expect,
- testcases[tc].actual,
- testcases[tc].description +" = "+ testcases[tc].actual );
- testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
- }
- stopTest();
- return ( testcases );
-}
diff --git a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.2.1-1.js b/JavaScriptCore/tests/mozilla/ecma/Array/15.4.2.1-1.js
deleted file mode 100644
index 4c1c0c6..0000000
--- a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.2.1-1.js
+++ /dev/null
@@ -1,92 +0,0 @@
-/* The contents of this file are subject to the Netscape Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/NPL/
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * The Original Code is Mozilla Communicator client code, released March
- * 31, 1998.
- *
- * The Initial Developer of the Original Code is Netscape Communications
- * Corporation. Portions created by Netscape are
- * Copyright (C) 1998 Netscape Communications Corporation. All
- * Rights Reserved.
- *
- * Contributor(s):
- *
- */
-/**
- File Name: 15.4.2.1-1.js
- ECMA Section: 15.4.2.1 new Array( item0, item1, ... )
- Description: This description only applies of the constructor is
- given two or more arguments.
-
- The [[Prototype]] property of the newly constructed
- object is set to the original Array prototype object,
- the one that is the initial value of Array.prototype
- (15.4.3.1).
-
- The [[Class]] property of the newly constructed object
- is set to "Array".
-
- The length property of the newly constructed object is
- set to the number of arguments.
-
- The 0 property of the newly constructed object is set
- to item0... in general, for as many arguments as there
- are, the k property of the newly constructed object is
- set to argument k, where the first argument is
- considered to be argument number 0.
-
- This file tests the typeof the newly constructed object.
-
- Author: christine@netscape.com
- Date: 7 october 1997
-*/
-
- var SECTION = "15.4.2.1-1";
- var VERSION = "ECMA_1";
- startTest();
- var TITLE = "The Array Constructor: new Array( item0, item1, ...)";
-
- writeHeaderToLog( SECTION + " "+ TITLE);
-
- var testcases = getTestCases();
- test();
-
-
-function getTestCases() {
- var array = new Array();
- var item = 0;
-
- array[item++] = new TestCase( SECTION, "typeof new Array(1,2)", "object", typeof new Array(1,2) );
- array[item++] = new TestCase( SECTION, "(new Array(1,2)).toString", Array.prototype.toString, (new Array(1,2)).toString );
- array[item++] = new TestCase( SECTION,
- "var arr = new Array(1,2,3); arr.getClass = Object.prototype.toString; arr.getClass()",
- "[object Array]",
- eval("var arr = new Array(1,2,3); arr.getClass = Object.prototype.toString; arr.getClass()") );
-
- array[item++] = new TestCase( SECTION, "(new Array(1,2)).length", 2, (new Array(1,2)).length );
- array[item++] = new TestCase( SECTION, "var arr = (new Array(1,2)); arr[0]", 1, eval("var arr = (new Array(1,2)); arr[0]") );
- array[item++] = new TestCase( SECTION, "var arr = (new Array(1,2)); arr[1]", 2, eval("var arr = (new Array(1,2)); arr[1]") );
- array[item++] = new TestCase( SECTION, "var arr = (new Array(1,2)); String(arr)", "1,2", eval("var arr = (new Array(1,2)); String(arr)") );
-
- return ( array );
-}
-function test() {
- for ( tc=0; tc < testcases.length; tc++ ) {
- testcases[tc].passed = writeTestCaseResult(
- testcases[tc].expect,
- testcases[tc].actual,
- testcases[tc].description +" = "+
- testcases[tc].actual );
-
- testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
- }
- stopTest();
- return ( testcases );
-}
diff --git a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.2.1-2.js b/JavaScriptCore/tests/mozilla/ecma/Array/15.4.2.1-2.js
deleted file mode 100644
index d5a65de..0000000
--- a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.2.1-2.js
+++ /dev/null
@@ -1,83 +0,0 @@
-/* The contents of this file are subject to the Netscape Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/NPL/
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * The Original Code is Mozilla Communicator client code, released March
- * 31, 1998.
- *
- * The Initial Developer of the Original Code is Netscape Communications
- * Corporation. Portions created by Netscape are
- * Copyright (C) 1998 Netscape Communications Corporation. All
- * Rights Reserved.
- *
- * Contributor(s):
- *
- */
-/**
- File Name: 15.4.2.1-2.js
- ECMA Section: 15.4.2.1 new Array( item0, item1, ... )
- Description: This description only applies of the constructor is
- given two or more arguments.
-
- The [[Prototype]] property of the newly constructed
- object is set to the original Array prototype object,
- the one that is the initial value of Array.prototype
- (15.4.3.1).
-
- The [[Class]] property of the newly constructed object
- is set to "Array".
-
- The length property of the newly constructed object is
- set to the number of arguments.
-
- The 0 property of the newly constructed object is set
- to item0... in general, for as many arguments as there
- are, the k property of the newly constructed object is
- set to argument k, where the first argument is
- considered to be argument number 0.
-
-
- Author: christine@netscape.com
- Date: 7 october 1997
-*/
- var SECTION = "15.4.2.1-2";
- var VERSION = "ECMA_1";
- startTest();
- var TITLE = "The Array Constructor: new Array( item0, item1, ...)";
-
- writeHeaderToLog( SECTION + " "+ TITLE);
-
- testcases = getTestCases();
-
- test();
-
-function getTestCases() {
- var array = new Array();
-
- var TEST_STRING = "new Array(";
- var ARGUMENTS = ""
- var TEST_LENGTH = Math.pow(2,10); //Math.pow(2,32);
-
- for ( var index = 0; index < TEST_LENGTH; index++ ) {
- ARGUMENTS += index;
- ARGUMENTS += (index == (TEST_LENGTH-1) ) ? "" : ",";
- }
-
- TEST_STRING += ARGUMENTS + ")";
-
- TEST_ARRAY = eval( TEST_STRING );
-
- for ( item = 0; item < TEST_LENGTH; item++ ) {
- array[item] = new TestCase( SECTION, "["+item+"]", item, TEST_ARRAY[item] );
- }
-
- array[item++ ] = new TestCase( SECTION, "new Array( ["+TEST_LENGTH+" arguments] ) +''", ARGUMENTS, TEST_ARRAY +"" );
-
- return ( array );
-}
diff --git a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.2.1-3.js b/JavaScriptCore/tests/mozilla/ecma/Array/15.4.2.1-3.js
deleted file mode 100644
index b299183..0000000
--- a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.2.1-3.js
+++ /dev/null
@@ -1,112 +0,0 @@
-/* The contents of this file are subject to the Netscape Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/NPL/
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * The Original Code is Mozilla Communicator client code, released March
- * 31, 1998.
- *
- * The Initial Developer of the Original Code is Netscape Communications
- * Corporation. Portions created by Netscape are
- * Copyright (C) 1998 Netscape Communications Corporation. All
- * Rights Reserved.
- *
- * Contributor(s):
- *
- */
-/**
- File Name: 15.4.2.1-3.js
- ECMA Section: 15.4.2.1 new Array( item0, item1, ... )
- Description: This description only applies of the constructor is
- given two or more arguments.
-
- The [[Prototype]] property of the newly constructed
- object is set to the original Array prototype object,
- the one that is the initial value of Array.prototype
- (15.4.3.1).
-
- The [[Class]] property of the newly constructed object
- is set to "Array".
-
- The length property of the newly constructed object is
- set to the number of arguments.
-
- The 0 property of the newly constructed object is set
- to item0... in general, for as many arguments as there
- are, the k property of the newly constructed object is
- set to argument k, where the first argument is
- considered to be argument number 0.
-
- This test stresses the number of arguments presented to
- the Array constructor. Should support up to Math.pow
- (2,32) arguments, since that is the maximum length of an
- ECMAScript array.
-
- ***Change TEST_LENGTH to Math.pow(2,32) when larger array
- lengths are supported.
-
- Author: christine@netscape.com
- Date: 7 october 1997
-*/
- var SECTION = "15.4.2.1-3";
- var VERSION = "ECMA_1";
- startTest();
- var TITLE = "The Array Constructor: new Array( item0, item1, ...)";
-
- writeHeaderToLog( SECTION + " "+ TITLE);
-
- var testcases = getTestCases();
- test();
-
-function getTestCases() {
- var array = new Array();
-
- var TEST_STRING = "new Array(";
- var ARGUMENTS = ""
- var TEST_LENGTH = Math.pow(2,10); //Math.pow(2,32);
-
- for ( var index = 0; index < TEST_LENGTH; index++ ) {
- ARGUMENTS += index;
- ARGUMENTS += (index == (TEST_LENGTH-1) ) ? "" : ",";
- }
-
- TEST_STRING += ARGUMENTS + ")";
-
- TEST_ARRAY = eval( TEST_STRING );
-
- for ( item = 0; item < TEST_LENGTH; item++ ) {
- array[item] = new TestCase( SECTION, "TEST_ARRAY["+item+"]", item, TEST_ARRAY[item] );
- }
-
- array[item++] = new TestCase( SECTION, "new Array( ["+TEST_LENGTH+" arguments] ) +''", ARGUMENTS, TEST_ARRAY +"" );
- array[item++] = new TestCase( SECTION, "TEST_ARRAY.toString", Array.prototype.toString, TEST_ARRAY.toString );
- array[item++] = new TestCase( SECTION, "TEST_ARRAY.join", Array.prototype.join, TEST_ARRAY.join );
- array[item++] = new TestCase( SECTION, "TEST_ARRAY.sort", Array.prototype.sort, TEST_ARRAY.sort );
- array[item++] = new TestCase( SECTION, "TEST_ARRAY.reverse", Array.prototype.reverse, TEST_ARRAY.reverse );
- array[item++] = new TestCase( SECTION, "TEST_ARRAY.length", TEST_LENGTH, TEST_ARRAY.length );
- array[item++] = new TestCase( SECTION,
- "TEST_ARRAY.toString = Object.prototype.toString; TEST_ARRAY.toString()",
- "[object Array]",
- eval("TEST_ARRAY.toString = Object.prototype.toString; TEST_ARRAY.toString()") );
-
- return ( array );
-}
-
-function test() {
- for ( tc=0; tc < testcases.length; tc++ ) {
- testcases[tc].passed = writeTestCaseResult(
- testcases[tc].expect,
- testcases[tc].actual,
- testcases[tc].description +" = "+
- testcases[tc].actual );
-
- testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
- }
- stopTest();
- return ( testcases );
-}
diff --git a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.2.2-1.js b/JavaScriptCore/tests/mozilla/ecma/Array/15.4.2.2-1.js
deleted file mode 100644
index a2e41ef..0000000
--- a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.2.2-1.js
+++ /dev/null
@@ -1,124 +0,0 @@
-/* The contents of this file are subject to the Netscape Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/NPL/
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * The Original Code is Mozilla Communicator client code, released March
- * 31, 1998.
- *
- * The Initial Developer of the Original Code is Netscape Communications
- * Corporation. Portions created by Netscape are
- * Copyright (C) 1998 Netscape Communications Corporation. All
- * Rights Reserved.
- *
- * Contributor(s):
- *
- */
-/**
- File Name: 15.4.2.2-1.js
- ECMA Section: 15.4.2.2 new Array(len)
-
- Description: This description only applies of the constructor is
- given two or more arguments.
-
- The [[Prototype]] property of the newly constructed
- object is set to the original Array prototype object,
- the one that is the initial value of Array.prototype(0)
- (15.4.3.1).
-
- The [[Class]] property of the newly constructed object
- is set to "Array".
-
- If the argument len is a number, then the length
- property of the newly constructed object is set to
- ToUint32(len).
-
- If the argument len is not a number, then the length
- property of the newly constructed object is set to 1
- and the 0 property of the newly constructed object is
- set to len.
-
- This file tests cases where len is a number.
-
- The cases in this test need to be updated since the
- ToUint32 description has changed.
-
- Author: christine@netscape.com
- Date: 7 october 1997
-*/
- var SECTION = "15.4.2.2-1";
- var VERSION = "ECMA_1";
- startTest();
- var TITLE = "The Array Constructor: new Array( len )";
-
- writeHeaderToLog( SECTION + " "+ TITLE);
-
- var testcases = getTestCases();
- test();
-
-function getTestCases() {
- var array = new Array();
- var item = 0;
-
- array[item++] = new TestCase( SECTION, "new Array(0)", "", (new Array(0)).toString() );
- array[item++] = new TestCase( SECTION, "typeof new Array(0)", "object", (typeof new Array(0)) );
- array[item++] = new TestCase( SECTION, "(new Array(0)).length", 0, (new Array(0)).length );
- array[item++] = new TestCase( SECTION, "(new Array(0)).toString", Array.prototype.toString, (new Array(0)).toString );
-
- array[item++] = new TestCase( SECTION, "new Array(1)", "", (new Array(1)).toString() );
- array[item++] = new TestCase( SECTION, "new Array(1).length", 1, (new Array(1)).length );
- array[item++] = new TestCase( SECTION, "(new Array(1)).toString", Array.prototype.toString, (new Array(1)).toString );
-
- array[item++] = new TestCase( SECTION, "(new Array(-0)).length", 0, (new Array(-0)).length );
- array[item++] = new TestCase( SECTION, "(new Array(0)).length", 0, (new Array(0)).length );
-
- array[item++] = new TestCase( SECTION, "(new Array(10)).length", 10, (new Array(10)).length );
- array[item++] = new TestCase( SECTION, "(new Array('1')).length", 1, (new Array('1')).length );
- array[item++] = new TestCase( SECTION, "(new Array(1000)).length", 1000, (new Array(1000)).length );
- array[item++] = new TestCase( SECTION, "(new Array('1000')).length", 1, (new Array('1000')).length );
-
- array[item++] = new TestCase( SECTION, "(new Array(4294967295)).length", ToUint32(4294967295), (new Array(4294967295)).length );
-
- array[item++] = new TestCase( SECTION, "(new Array('8589934592')).length", 1, (new Array("8589934592")).length );
- array[item++] = new TestCase( SECTION, "(new Array('4294967296')).length", 1, (new Array("4294967296")).length );
- array[item++] = new TestCase( SECTION, "(new Array(1073741824)).length", ToUint32(1073741824), (new Array(1073741824)).length );
-
- return ( array );
-}
-function test() {
- for ( tc=0; tc < testcases.length; tc++ ) {
- testcases[tc].passed = writeTestCaseResult(
- testcases[tc].expect,
- testcases[tc].actual,
- testcases[tc].description +" = "+
- testcases[tc].actual );
-
- testcases[tc].reason += ( testcases[tc].passed )
- ? ""
- : "wrong value ";
- }
- stopTest();
- return ( testcases );
-}
-function ToUint32( n ) {
- n = Number( n );
- var sign = ( n < 0 ) ? -1 : 1;
-
- if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) {
- return 0;
- }
- n = sign * Math.floor( Math.abs(n) )
-
- n = n % Math.pow(2,32);
-
- if ( n < 0 ){
- n += Math.pow(2,32);
- }
-
- return ( n );
-} \ No newline at end of file
diff --git a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.2.2-2.js b/JavaScriptCore/tests/mozilla/ecma/Array/15.4.2.2-2.js
deleted file mode 100644
index c360702..0000000
--- a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.2.2-2.js
+++ /dev/null
@@ -1,89 +0,0 @@
-/* The contents of this file are subject to the Netscape Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/NPL/
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * The Original Code is Mozilla Communicator client code, released March
- * 31, 1998.
- *
- * The Initial Developer of the Original Code is Netscape Communications
- * Corporation. Portions created by Netscape are
- * Copyright (C) 1998 Netscape Communications Corporation. All
- * Rights Reserved.
- *
- * Contributor(s):
- *
- */
-/**
- File Name: 15.4.2.2-2.js
- ECMA Section: 15.4.2.2 new Array(len)
-
- Description: This description only applies of the constructor is
- given two or more arguments.
-
- The [[Prototype]] property of the newly constructed
- object is set to the original Array prototype object,
- the one that is the initial value of Array.prototype(0)
- (15.4.3.1).
-
- The [[Class]] property of the newly constructed object
- is set to "Array".
-
- If the argument len is a number, then the length
- property of the newly constructed object is set to
- ToUint32(len).
-
- If the argument len is not a number, then the length
- property of the newly constructed object is set to 1
- and the 0 property of the newly constructed object is
- set to len.
-
- This file tests length of the newly constructed array
- when len is not a number.
-
- Author: christine@netscape.com
- Date: 7 october 1997
-*/
- var SECTION = "15.4.2.2-2";
- var VERSION = "ECMA_1";
- startTest();
- var TITLE = "The Array Constructor: new Array( len )";
-
- writeHeaderToLog( SECTION + " "+ TITLE);
-
- var testcases = getTestCases();
- test();
-
-function getTestCases() {
- var array = new Array();
- var item = 0;
-
- array[item++] = new TestCase( SECTION, "(new Array(new Number(1073741823))).length", 1, (new Array(new Number(1073741823))).length );
- array[item++] = new TestCase( SECTION, "(new Array(new Number(0))).length", 1, (new Array(new Number(0))).length );
- array[item++] = new TestCase( SECTION, "(new Array(new Number(1000))).length", 1, (new Array(new Number(1000))).length );
- array[item++] = new TestCase( SECTION, "(new Array('mozilla, larryzilla, curlyzilla')).length", 1, (new Array('mozilla, larryzilla, curlyzilla')).length );
- array[item++] = new TestCase( SECTION, "(new Array(true)).length", 1, (new Array(true)).length );
- array[item++] = new TestCase( SECTION, "(new Array(false)).length", 1, (new Array(false)).length);
- array[item++] = new TestCase( SECTION, "(new Array(new Boolean(true)).length", 1, (new Array(new Boolean(true))).length );
- array[item++] = new TestCase( SECTION, "(new Array(new Boolean(false)).length", 1, (new Array(new Boolean(false))).length );
- return ( array );
-}
-function test() {
- for ( tc=0; tc < testcases.length; tc++ ) {
- testcases[tc].passed = writeTestCaseResult(
- testcases[tc].expect,
- testcases[tc].actual,
- testcases[tc].description +" = "+
- testcases[tc].actual );
- testcases[tc].reason += ( testcases[tc].passed )
- ? ""
- : "wrong value ";
- }
- stopTest();
- return ( testcases );
-}
diff --git a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.2.3.js b/JavaScriptCore/tests/mozilla/ecma/Array/15.4.2.3.js
deleted file mode 100644
index 2ddd31b..0000000
--- a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.2.3.js
+++ /dev/null
@@ -1,74 +0,0 @@
-/* The contents of this file are subject to the Netscape Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/NPL/
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * The Original Code is Mozilla Communicator client code, released March
- * 31, 1998.
- *
- * The Initial Developer of the Original Code is Netscape Communications
- * Corporation. Portions created by Netscape are
- * Copyright (C) 1998 Netscape Communications Corporation. All
- * Rights Reserved.
- *
- * Contributor(s):
- *
- */
-/**
- File Name: 15.4.2.3.js
- ECMA Section: 15.4.2.3 new Array()
- Description: The [[Prototype]] property of the newly constructed
- object is set to the origianl Array prototype object,
- the one that is the initial value of Array.prototype.
- The [[Class]] property of the new object is set to
- "Array". The length of the object is set to 0.
-
- Author: christine@netscape.com
- Date: 7 october 1997
-*/
-
- var SECTION = "15.4.2.3";
- var VERSION = "ECMA_1";
- startTest();
- var TITLE = "The Array Constructor: new Array()";
-
- writeHeaderToLog( SECTION + " "+ TITLE);
-
- var testcases = getTestCases();
- test();
-
-function getTestCases() {
- var array = new Array();
- var item = 0;
- array[item++] = new TestCase( SECTION, "new Array() +''", "", (new Array()) +"" );
- array[item++] = new TestCase( SECTION, "typeof new Array()", "object", (typeof new Array()) );
- array[item++] = new TestCase( SECTION,
- "var arr = new Array(); arr.getClass = Object.prototype.toString; arr.getClass()",
- "[object Array]",
- eval("var arr = new Array(); arr.getClass = Object.prototype.toString; arr.getClass()") );
-
- array[item++] = new TestCase( SECTION, "(new Array()).length", 0, (new Array()).length );
- array[item++] = new TestCase( SECTION, "(new Array()).toString == Array.prototype.toString", true, (new Array()).toString == Array.prototype.toString );
- array[item++] = new TestCase( SECTION, "(new Array()).join == Array.prototype.join", true, (new Array()).join == Array.prototype.join );
- array[item++] = new TestCase( SECTION, "(new Array()).reverse == Array.prototype.reverse", true, (new Array()).reverse == Array.prototype.reverse );
- array[item++] = new TestCase( SECTION, "(new Array()).sort == Array.prototype.sort", true, (new Array()).sort == Array.prototype.sort );
-
- return ( array );
-}
-function test() {
- for ( tc=0; tc < testcases.length; tc++ ) {
- testcases[tc].passed = writeTestCaseResult(
- testcases[tc].expect,
- testcases[tc].actual,
- testcases[tc].description +" = "+ testcases[tc].actual );
-
- testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
- }
- stopTest();
- return ( testcases );
-}
diff --git a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.3.1-2.js b/JavaScriptCore/tests/mozilla/ecma/Array/15.4.3.1-2.js
deleted file mode 100644
index 994ce5e..0000000
--- a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.3.1-2.js
+++ /dev/null
@@ -1,66 +0,0 @@
-/* The contents of this file are subject to the Netscape Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/NPL/
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * The Original Code is Mozilla Communicator client code, released March
- * 31, 1998.
- *
- * The Initial Developer of the Original Code is Netscape Communications
- * Corporation. Portions created by Netscape are
- * Copyright (C) 1998 Netscape Communications Corporation. All
- * Rights Reserved.
- *
- * Contributor(s):
- *
- */
-/**
- File Name: 15.4.3.1-1.js
- ECMA Section: 15.4.3.1 Array.prototype
- Description: The initial value of Array.prototype is the built-in
- Array prototype object (15.4.4).
-
- Author: christine@netscape.com
- Date: 7 october 1997
-*/
-
- var SECTION = "15.4.3.1-1";
- var VERSION = "ECMA_1";
- startTest();
- var TITLE = "Array.prototype";
-
- writeHeaderToLog( SECTION + " "+ TITLE);
-
- var testcases = getTestCases();
- test();
-
-function getTestCases() {
- var array = new Array();
- var item = 0;
- var ARRAY_PROTO = Array.prototype;
-
- array[item++] = new TestCase( SECTION, "var props = ''; for ( p in Array ) { props += p } props", "", eval("var props = ''; for ( p in Array ) { props += p } props") );
-
- array[item++] = new TestCase( SECTION, "Array.prototype = null; Array.prototype", ARRAY_PROTO, eval("Array.prototype = null; Array.prototype") );
-
- array[item++] = new TestCase( SECTION, "delete Array.prototype", false, delete Array.prototype );
- array[item++] = new TestCase( SECTION, "delete Array.prototype; Array.prototype", ARRAY_PROTO, eval("delete Array.prototype; Array.prototype") );
-
- return ( array );
-}
-function test() {
- for ( tc=0; tc < testcases.length; tc++ ) {
- testcases[tc].passed = writeTestCaseResult(
- testcases[tc].expect,
- testcases[tc].actual,
- testcases[tc].description +" = "+ testcases[tc].actual );
- testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
- }
- stopTest();
- return ( testcases );
-}
diff --git a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.3.2.js b/JavaScriptCore/tests/mozilla/ecma/Array/15.4.3.2.js
deleted file mode 100644
index 43c2b4c..0000000
--- a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.3.2.js
+++ /dev/null
@@ -1,57 +0,0 @@
-/* The contents of this file are subject to the Netscape Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/NPL/
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * The Original Code is Mozilla Communicator client code, released March
- * 31, 1998.
- *
- * The Initial Developer of the Original Code is Netscape Communications
- * Corporation. Portions created by Netscape are
- * Copyright (C) 1998 Netscape Communications Corporation. All
- * Rights Reserved.
- *
- * Contributor(s):
- *
- */
-/**
- File Name: 15.4.3.2.js
- ECMA Section: 15.4.3.2 Array.length
- Description: The length property is 1.
-
- Author: christine@netscape.com
- Date: 7 october 1997
-*/
-
- var SECTION = "15.4.3.2";
- var VERSION = "ECMA_1";
- startTest();
- var TITLE = "Array.length";
-
- writeHeaderToLog( SECTION + " "+ TITLE);
-
- var testcases = getTestCases();
- test();
-
-function getTestCases() {
- var array = new Array();
- var item = 0;
- array[item++] = new TestCase( SECTION, "Array.length", 1, Array.length );
- return ( array );
-}
-function test() {
- for ( tc=0; tc < testcases.length; tc++ ) {
- testcases[tc].passed = writeTestCaseResult(
- testcases[tc].expect,
- testcases[tc].actual,
- testcases[tc].description +" = "+ testcases[tc].actual );
- testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
- }
- stopTest();
- return ( testcases );
-}
diff --git a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.3.js b/JavaScriptCore/tests/mozilla/ecma/Array/15.4.3.js
deleted file mode 100644
index b44c6cb..0000000
--- a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.3.js
+++ /dev/null
@@ -1,63 +0,0 @@
-/* The contents of this file are subject to the Netscape Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/NPL/
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * The Original Code is Mozilla Communicator client code, released March
- * 31, 1998.
- *
- * The Initial Developer of the Original Code is Netscape Communications
- * Corporation. Portions created by Netscape are
- * Copyright (C) 1998 Netscape Communications Corporation. All
- * Rights Reserved.
- *
- * Contributor(s):
- *
- */
-/**
- File Name: 15.4.3.js
- ECMA Section: 15.4.3 Properties of the Array Constructor
- Description: The value of the internal [[Prototype]] property of the
- Array constructor is the Function prototype object.
-
- Author: christine@netscape.com
- Date: 7 october 1997
-*/
-
- var SECTION = "15.4.3";
- var VERSION = "ECMA_2";
- startTest();
- var TITLE = "Properties of the Array Constructor";
-
- writeHeaderToLog( SECTION + " "+ TITLE);
-
- var testcases = getTestCases();
- test();
-
-function getTestCases() {
- var array = new Array();
- var item = 0;
-
- array[item++] = new TestCase( SECTION, "Array.__proto__", Function.prototype, Array.__proto__ );
-
- return ( array );
-}
-function test() {
- for (tc=0 ; tc < testcases.length; tc++ ) {
- testcases[tc].passed = writeTestCaseResult(
- testcases[tc].expect,
- testcases[tc].actual,
- testcases[tc].description +" = "+ testcases[tc].actual );
-
- testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
- }
-
- stopTest();
-
- return ( testcases );
-}
diff --git a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.4.1.js b/JavaScriptCore/tests/mozilla/ecma/Array/15.4.4.1.js
deleted file mode 100644
index 4b46136..0000000
--- a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.4.1.js
+++ /dev/null
@@ -1,57 +0,0 @@
-/* The contents of this file are subject to the Netscape Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/NPL/
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * The Original Code is Mozilla Communicator client code, released March
- * 31, 1998.
- *
- * The Initial Developer of the Original Code is Netscape Communications
- * Corporation. Portions created by Netscape are
- * Copyright (C) 1998 Netscape Communications Corporation. All
- * Rights Reserved.
- *
- * Contributor(s):
- *
- */
-/**
- File Name: 15.4.4.1.js
- ECMA Section: 15.4.4.1 Array.prototype.constructor
- Description: The initial value of Array.prototype.constructor
- is the built-in Array constructor.
- Author: christine@netscape.com
- Date: 7 october 1997
-*/
-
- var SECTION = "15.4.4.1";
- var VERSION = "ECMA_1";
- startTest();
- var TITLE = "Array.prototype.constructor";
-
- writeHeaderToLog( SECTION + " "+ TITLE);
-
- var testcases = getTestCases();
- test();
-
-function getTestCases() {
- var array = new Array();
- var item = 0;
- array[item++] = new TestCase( SECTION, "Array.prototype.constructor == Array", true, Array.prototype.constructor == Array);
- return ( array );
-}
-function test() {
- for (tc=0 ; tc < testcases.length; tc++ ) {
- testcases[tc].passed = writeTestCaseResult(
- testcases[tc].expect,
- testcases[tc].actual,
- testcases[tc].description +" = "+ testcases[tc].actual );
- testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
- }
- stopTest();
- return ( testcases );
-}
diff --git a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.4.2.js b/JavaScriptCore/tests/mozilla/ecma/Array/15.4.4.2.js
deleted file mode 100644
index 9565798..0000000
--- a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.4.2.js
+++ /dev/null
@@ -1,83 +0,0 @@
-/* The contents of this file are subject to the Netscape Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/NPL/
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * The Original Code is Mozilla Communicator client code, released March
- * 31, 1998.
- *
- * The Initial Developer of the Original Code is Netscape Communications
- * Corporation. Portions created by Netscape are
- * Copyright (C) 1998 Netscape Communications Corporation. All
- * Rights Reserved.
- *
- * Contributor(s):
- *
- */
-/**
- File Name: 15.4.4.2.js
- ECMA Section: 15.4.4.2 Array.prototype.toString()
- Description: The elements of this object are converted to strings
- and these strings are then concatenated, separated by
- comma characters. The result is the same as if the
- built-in join method were invoiked for this object
- with no argument.
- Author: christine@netscape.com
- Date: 7 october 1997
-*/
-
- var SECTION = "15.4.4.2";
- var VERSION = "ECMA_1";
- startTest();
- var TITLE = "Array.prototype.toString";
-
- writeHeaderToLog( SECTION + " "+ TITLE);
-
- var testcases = getTestCases();
- test();
-
-function getTestCases() {
- var array = new Array();
- var item = 0;
-
- array[item++] = new TestCase( SECTION, "Array.prototype.toString.length", 0, Array.prototype.toString.length );
-
- array[item++] = new TestCase( SECTION, "(new Array()).toString()", "", (new Array()).toString() );
- array[item++] = new TestCase( SECTION, "(new Array(2)).toString()", ",", (new Array(2)).toString() );
- array[item++] = new TestCase( SECTION, "(new Array(0,1)).toString()", "0,1", (new Array(0,1)).toString() );
- array[item++] = new TestCase( SECTION, "(new Array( Number.NaN, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY)).toString()", "NaN,Infinity,-Infinity", (new Array( Number.NaN, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY)).toString() );
-
- array[item++] = new TestCase( SECTION, "(new Array( Boolean(1), Boolean(0))).toString()", "true,false", (new Array(Boolean(1),Boolean(0))).toString() );
- array[item++] = new TestCase( SECTION, "(new Array(void 0,null)).toString()", ",", (new Array(void 0,null)).toString() );
-
- var EXPECT_STRING = "";
- var MYARR = new Array();
-
- for ( var i = -50; i < 50; i+= 0.25 ) {
- MYARR[MYARR.length] = i;
- EXPECT_STRING += i +",";
- }
-
- EXPECT_STRING = EXPECT_STRING.substring( 0, EXPECT_STRING.length -1 );
-
- array[item++] = new TestCase( SECTION, "MYARR.toString()", EXPECT_STRING, MYARR.toString() );
-
-
- return ( array );
-}
-function test() {
- for ( tc=0 ; tc < testcases.length; tc++ ) {
- testcases[tc].passed = writeTestCaseResult(
- testcases[tc].expect,
- testcases[tc].actual,
- testcases[tc].description +" = "+ testcases[tc].actual );
- testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
- }
- stopTest();
- return ( testcases );
-}
diff --git a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.4.3-1.js b/JavaScriptCore/tests/mozilla/ecma/Array/15.4.4.3-1.js
deleted file mode 100644
index 63ec5b0..0000000
--- a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.4.3-1.js
+++ /dev/null
@@ -1,159 +0,0 @@
-/* The contents of this file are subject to the Netscape Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/NPL/
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * The Original Code is Mozilla Communicator client code, released March
- * 31, 1998.
- *
- * The Initial Developer of the Original Code is Netscape Communications
- * Corporation. Portions created by Netscape are
- * Copyright (C) 1998 Netscape Communications Corporation. All
- * Rights Reserved.
- *
- * Contributor(s):
- *
- */
-/**
- File Name: 15.4.4.3-1.js
- ECMA Section: 15.4.4.3-1 Array.prototype.join()
- Description: The elements of this object are converted to strings and
- these strings are then concatenated, separated by comma
- characters. The result is the same as if the built-in join
- method were invoiked for this object with no argument.
- Author: christine@netscape.com, pschwartau@netscape.com
- Date: 07 October 1997
- Modified: 14 July 2002
- Reason: See http://bugzilla.mozilla.org/show_bug.cgi?id=155285
- ECMA-262 Ed.3 Section 15.4.4.5 Array.prototype.join()
- Step 3: If |separator| is |undefined|, let |separator|
- be the single-character string ","
-*
-*/
-
- var SECTION = "15.4.4.3-1";
- var VERSION = "ECMA_1";
- startTest();
-
- writeHeaderToLog( SECTION + " Array.prototype.join()");
-
- var testcases = getTestCases();
- test();
-
-function getTestCases() {
- var array = new Array();
- var item = 0;
-
- var ARR_PROTOTYPE = Array.prototype;
-
- array[item++] = new TestCase( SECTION, "Array.prototype.join.length", 1, Array.prototype.join.length );
- array[item++] = new TestCase( SECTION, "delete Array.prototype.join.length", false, delete Array.prototype.join.length );
- array[item++] = new TestCase( SECTION, "delete Array.prototype.join.length; Array.prototype.join.length", 1, eval("delete Array.prototype.join.length; Array.prototype.join.length") );
-
- // case where array length is 0
-
- array[item++] = new TestCase( SECTION,
- "var TEST_ARRAY = new Array(); TEST_ARRAY.join()",
- "",
- eval("var TEST_ARRAY = new Array(); TEST_ARRAY.join()") );
-
- // array length is 0, but spearator is specified
-
- array[item++] = new TestCase( SECTION,
- "var TEST_ARRAY = new Array(); TEST_ARRAY.join(' ')",
- "",
- eval("var TEST_ARRAY = new Array(); TEST_ARRAY.join(' ')") );
-
- // length is greater than 0, separator is supplied
- array[item++] = new TestCase( SECTION,
- "var TEST_ARRAY = new Array(null, void 0, true, false, 123, new Object(), new Boolean(true) ); TEST_ARRAY.join('&')",
- "&&true&false&123&[object Object]&true",
- eval("var TEST_ARRAY = new Array(null, void 0, true, false, 123, new Object(), new Boolean(true) ); TEST_ARRAY.join('&')") );
-
- // length is greater than 0, separator is empty string
- array[item++] = new TestCase( SECTION,
- "var TEST_ARRAY = new Array(null, void 0, true, false, 123, new Object(), new Boolean(true) ); TEST_ARRAY.join('')",
- "truefalse123[object Object]true",
- eval("var TEST_ARRAY = new Array(null, void 0, true, false, 123, new Object(), new Boolean(true) ); TEST_ARRAY.join('')") );
- // length is greater than 0, separator is undefined
- array[item++] = new TestCase( SECTION,
- "var TEST_ARRAY = new Array(null, void 0, true, false, 123, new Object(), new Boolean(true) ); TEST_ARRAY.join(void 0)",
- ",,true,false,123,[object Object],true",
- eval("var TEST_ARRAY = new Array(null, void 0, true, false, 123, new Object(), new Boolean(true) ); TEST_ARRAY.join(void 0)") );
-
- // length is greater than 0, separator is not supplied
- array[item++] = new TestCase( SECTION,
- "var TEST_ARRAY = new Array(null, void 0, true, false, 123, new Object(), new Boolean(true) ); TEST_ARRAY.join()",
- ",,true,false,123,[object Object],true",
- eval("var TEST_ARRAY = new Array(null, void 0, true, false, 123, new Object(), new Boolean(true) ); TEST_ARRAY.join()") );
-
- // separator is a control character
- array[item++] = new TestCase( SECTION,
- "var TEST_ARRAY = new Array(null, void 0, true, false, 123, new Object(), new Boolean(true) ); TEST_ARRAY.join('\v')",
- unescape("%u000B%u000Btrue%u000Bfalse%u000B123%u000B[object Object]%u000Btrue"),
- eval("var TEST_ARRAY = new Array(null, void 0, true, false, 123, new Object(), new Boolean(true) ); TEST_ARRAY.join('\v')") );
-
- // length of array is 1
- array[item++] = new TestCase( SECTION,
- "var TEST_ARRAY = new Array(true) ); TEST_ARRAY.join('\v')",
- "true",
- eval("var TEST_ARRAY = new Array(true); TEST_ARRAY.join('\v')") );
-
-
- SEPARATOR = "\t"
- TEST_LENGTH = 100;
- TEST_STRING = "";
- ARGUMENTS = "";
- TEST_RESULT = "";
-
- for ( var index = 0; index < TEST_LENGTH; index++ ) {
- ARGUMENTS += index;
- ARGUMENTS += ( index == TEST_LENGTH -1 ) ? "" : ",";
-
- TEST_RESULT += index;
- TEST_RESULT += ( index == TEST_LENGTH -1 ) ? "" : SEPARATOR;
- }
-
- TEST_ARRAY = eval( "new Array( "+ARGUMENTS +")" );
-
- array[item++] = new TestCase( SECTION, "TEST_ARRAY.join("+SEPARATOR+")", TEST_RESULT, TEST_ARRAY.join( SEPARATOR ) );
-
- array[item++] = new TestCase( SECTION, "(new Array( Boolean(true), Boolean(false), null, void 0, Number(1e+21), Number(1e-7))).join()",
- "true,false,,,1e+21,1e-7",
- (new Array( Boolean(true), Boolean(false), null, void 0, Number(1e+21), Number(1e-7))).join() );
-
- // this is not an Array object
- array[item++] = new TestCase( SECTION,
- "var OB = new Object_1('true,false,111,0.5,1.23e6,NaN,void 0,null'); OB.join(':')",
- "true:false:111:0.5:1230000:NaN::",
- eval("var OB = new Object_1('true,false,111,0.5,1.23e6,NaN,void 0,null'); OB.join(':')") );
-
-
-
- return ( array );
-}
-function test() {
- for ( tc=0; tc < testcases.length; tc++ ) {
- testcases[tc].passed = writeTestCaseResult(
- testcases[tc].expect,
- testcases[tc].actual,
- testcases[tc].description +" = "+ testcases[tc].actual );
- testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
- }
- stopTest();
- return ( testcases );
-}
-function Object_1( value ) {
- this.array = value.split(",");
- this.length = this.array.length;
- for ( var i = 0; i < this.length; i++ ) {
- this[i] = eval(this.array[i]);
- }
- this.join = Array.prototype.join;
- this.getClass = Object.prototype.toString;
-}
diff --git a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.4.4-1.js b/JavaScriptCore/tests/mozilla/ecma/Array/15.4.4.4-1.js
deleted file mode 100644
index c8e7422..0000000
--- a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.4.4-1.js
+++ /dev/null
@@ -1,272 +0,0 @@
-/* The contents of this file are subject to the Netscape Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/NPL/
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * The Original Code is Mozilla Communicator client code, released March
- * 31, 1998.
- *
- * The Initial Developer of the Original Code is Netscape Communications
- * Corporation. Portions created by Netscape are
- * Copyright (C) 1998 Netscape Communications Corporation. All
- * Rights Reserved.
- *
- * Contributor(s):
- *
- */
-/**
- File Name: 15.4.4.3-1.js
- ECMA Section: 15.4.4.3-1 Array.prototype.reverse()
- Description:
-
- The elements of the array are rearranged so as to reverse their order.
- This object is returned as the result of the call.
-
- 1. Call the [[Get]] method of this object with argument "length".
- 2. Call ToUint32(Result(1)).
- 3. Compute floor(Result(2)/2).
- 4. Let k be 0.
- 5. If k equals Result(3), return this object.
- 6. Compute Result(2)k1.
- 7. Call ToString(k).
- 8. ToString(Result(6)).
- 9. Call the [[Get]] method of this object with argument Result(7).
- 10. Call the [[Get]] method of this object with argument Result(8).
- 11. If this object has a property named by Result(8), go to step 12; but
- if this object has no property named by Result(8), then go to either
- step 12 or step 14, depending on the implementation.
- 12. Call the [[Put]] method of this object with arguments Result(7) and
- Result(10).
- 13. Go to step 15.
- 14. Call the [[Delete]] method on this object, providing Result(7) as the
- name of the property to delete.
- 15. If this object has a property named by Result(7), go to step 16; but if
- this object has no property named by Result(7), then go to either step 16
- or step 18, depending on the implementation.
- 16. Call the [[Put]] method of this object with arguments Result(8) and
- Result(9).
- 17. Go to step 19.
- 18. Call the [[Delete]] method on this object, providing Result(8) as the
- name of the property to delete.
- 19. Increase k by 1.
- 20. Go to step 5.
-
-Note that the reverse function is intentionally generic; it does not require
-that its this value be an Array object. Therefore it can be transferred to other
-kinds of objects for use as a method. Whether the reverse function can be applied
-successfully to a host object is implementation dependent.
-
- Note: Array.prototype.reverse allows some flexibility in implementation
- regarding array indices that have not been populated. This test covers the
- cases in which unpopulated indices are not deleted, since the JavaScript
- implementation does not delete uninitialzed indices.
-
- Author: christine@netscape.com
- Date: 7 october 1997
-*/
- var SECTION = "15.4.4.4-1";
- var VERSION = "ECMA_1";
- startTest();
- var BUGNUMBER="123724";
-
- writeHeaderToLog( SECTION + " Array.prototype.reverse()");
-
- var testcases = new Array();
- getTestCases();
- test();
-
-function getTestCases() {
- var ARR_PROTOTYPE = Array.prototype;
-
- testcases[testcases.length] = new TestCase( SECTION, "Array.prototype.reverse.length", 0, Array.prototype.reverse.length );
- testcases[testcases.length] = new TestCase( SECTION, "delete Array.prototype.reverse.length", false, delete Array.prototype.reverse.length );
- testcases[testcases.length] = new TestCase( SECTION, "delete Array.prototype.reverse.length; Array.prototype.reverse.length", 0, eval("delete Array.prototype.reverse.length; Array.prototype.reverse.length") );
-
- // length of array is 0
- testcases[testcases.length] = new TestCase( SECTION,
- "var A = new Array(); A.reverse(); A.length",
- 0,
- eval("var A = new Array(); A.reverse(); A.length") );
-
- // length of array is 1
- var A = new Array(true);
- var R = Reverse(A);
-
- testcases[testcases.length] = new TestCase( SECTION,
- "var A = new Array(true); A.reverse(); A.length",
- R.length,
- eval("var A = new Array(true); A.reverse(); A.length") );
- CheckItems( R, A );
-
- // length of array is 2
- var S = "var A = new Array( true,false )";
- eval(S);
- var R = Reverse(A);
-
- testcases[testcases.length] = new TestCase(
- SECTION,
- S +"; A.reverse(); A.length",
- R.length,
- eval( S + "; A.reverse(); A.length") );
-
- CheckItems( R, A );
-
- // length of array is 3
- var S = "var A = new Array( true,false,null )";
- eval(S);
- var R = Reverse(A);
-
- testcases[testcases.length] = new TestCase( SECTION,
- S +"; A.reverse(); A.length",
- R.length,
- eval( S + "; A.reverse(); A.length") );
- CheckItems( R, A );
-
- // length of array is 4
- var S = "var A = new Array( true,false,null,void 0 )";
- eval(S);
- var R = Reverse(A);
-
- testcases[testcases.length] = new TestCase( SECTION,
- S +"; A.reverse(); A.length",
- R.length,
- eval( S + "; A.reverse(); A.length") );
- CheckItems( R, A );
-
-
- // some array indexes have not been set
- var S = "var A = new Array(); A[8] = 'hi', A[3] = 'yo'";
- eval(S);
- var R = Reverse(A);
-
- testcases[testcases.length] = new TestCase( SECTION,
- S +"; A.reverse(); A.length",
- R.length,
- eval( S + "; A.reverse(); A.length") );
- CheckItems( R, A );
-
-
- var OBJECT_OBJECT = new Object();
- var FUNCTION_OBJECT = new Function( 'return this' );
- var BOOLEAN_OBJECT = new Boolean;
- var DATE_OBJECT = new Date(0);
- var STRING_OBJECT = new String('howdy');
- var NUMBER_OBJECT = new Number(Math.PI);
- var ARRAY_OBJECT= new Array(1000);
-
- var args = "null, void 0, Math.pow(2,32), 1.234e-32, OBJECT_OBJECT, BOOLEAN_OBJECT, FUNCTION_OBJECT, DATE_OBJECT, STRING_OBJECT,"+
- "ARRAY_OBJECT, NUMBER_OBJECT, Math, true, false, 123, '90210'";
-
- var S = "var A = new Array("+args+")";
- eval(S);
- var R = Reverse(A);
-
- testcases[testcases.length] = new TestCase( SECTION,
- S +"; A.reverse(); A.length",
- R.length,
- eval( S + "; A.reverse(); A.length") );
- CheckItems( R, A );
-
- var limit = 1000;
- var args = "";
- for (var i = 0; i < limit; i++ ) {
- args += i +"";
- if ( i + 1 < limit ) {
- args += ",";
- }
- }
-
- var S = "var A = new Array("+args+")";
- eval(S);
- var R = Reverse(A);
-
- testcases[testcases.length] = new TestCase( SECTION,
- S +"; A.reverse(); A.length",
- R.length,
- eval( S + "; A.reverse(); A.length") );
- CheckItems( R, A );
-
- var S = "var MYOBJECT = new Object_1( \"void 0, 1, null, 2, \'\'\" )";
- eval(S);
- var R = Reverse( A );
-
- testcases[testcases.length] = new TestCase( SECTION,
- S +"; A.reverse(); A.length",
- R.length,
- eval( S + "; A.reverse(); A.length") );
- CheckItems( R, A );
-
- return ( testcases );
-}
-function CheckItems( R, A ) {
- for ( var i = 0; i < R.length; i++ ) {
- testcases[testcases.length] = new TestCase(
- SECTION,
- "A["+i+ "]",
- R[i],
- A[i] );
- }
-}
-function test() {
- for ( tc=0; tc < testcases.length; tc++ ) {
- testcases[tc].passed = writeTestCaseResult(
- testcases[tc].expect,
- testcases[tc].actual,
- testcases[tc].description +" = "+ testcases[tc].actual );
- testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
- }
- stopTest();
- return ( testcases );
-}
-function Object_1( value ) {
- this.array = value.split(",");
- this.length = this.array.length;
- for ( var i = 0; i < this.length; i++ ) {
- this[i] = eval(this.array[i]);
- }
- this.join = Array.prototype.reverse;
- this.getClass = Object.prototype.toString;
-}
-function Reverse( array ) {
- var r2 = array.length;
- var k = 0;
- var r3 = Math.floor( r2/2 );
- if ( r3 == k ) {
- return array;
- }
-
- for ( k = 0; k < r3; k++ ) {
- var r6 = r2 - k - 1;
-// var r7 = String( k );
- var r7 = k;
- var r8 = String( r6 );
-
- var r9 = array[r7];
- var r10 = array[r8];
-
- array[r7] = r10;
- array[r8] = r9;
- }
-
- return array;
-}
-function Iterate( array ) {
- for ( var i = 0; i < array.length; i++ ) {
-// print( i+": "+ array[String(i)] );
- }
-}
-
-function Object_1( value ) {
- this.array = value.split(",");
- this.length = this.array.length;
- for ( var i = 0; i < this.length; i++ ) {
- this[i] = this.array[i];
- }
- this.reverse = Array.prototype.reverse;
- this.getClass = Object.prototype.toString;
-}
diff --git a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.4.4-2.js b/JavaScriptCore/tests/mozilla/ecma/Array/15.4.4.4-2.js
deleted file mode 100644
index 1d0d850..0000000
--- a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.4.4-2.js
+++ /dev/null
@@ -1,163 +0,0 @@
-/* The contents of this file are subject to the Netscape Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/NPL/
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * The Original Code is Mozilla Communicator client code, released March
- * 31, 1998.
- *
- * The Initial Developer of the Original Code is Netscape Communications
- * Corporation. Portions created by Netscape are
- * Copyright (C) 1998 Netscape Communications Corporation. All
- * Rights Reserved.
- *
- * Contributor(s):
- *
- */
-/**
- File Name: 15.4.4.3-1.js
- ECMA Section: 15.4.4.3-1 Array.prototype.reverse()
- Description:
-
- The elements of the array are rearranged so as to reverse their order.
- This object is returned as the result of the call.
-
- 1. Call the [[Get]] method of this object with argument "length".
- 2. Call ToUint32(Result(1)).
- 3. Compute floor(Result(2)/2).
- 4. Let k be 0.
- 5. If k equals Result(3), return this object.
- 6. Compute Result(2)k1.
- 7. Call ToString(k).
- 8. ToString(Result(6)).
- 9. Call the [[Get]] method of this object with argument Result(7).
- 10. Call the [[Get]] method of this object with argument Result(8).
- 11. If this object has a property named by Result(8), go to step 12; but
- if this object has no property named by Result(8), then go to either
- step 12 or step 14, depending on the implementation.
- 12. Call the [[Put]] method of this object with arguments Result(7) and
- Result(10).
- 13. Go to step 15.
- 14. Call the [[Delete]] method on this object, providing Result(7) as the
- name of the property to delete.
- 15. If this object has a property named by Result(7), go to step 16; but if
- this object has no property named by Result(7), then go to either step 16
- or step 18, depending on the implementation.
- 16. Call the [[Put]] method of this object with arguments Result(8) and
- Result(9).
- 17. Go to step 19.
- 18. Call the [[Delete]] method on this object, providing Result(8) as the
- name of the property to delete.
- 19. Increase k by 1.
- 20. Go to step 5.
-
-Note that the reverse function is intentionally generic; it does not require
-that its this value be an Array object. Therefore it can be transferred to other
-kinds of objects for use as a method. Whether the reverse function can be applied
-successfully to a host object is implementation dependent.
-
- Note: Array.prototype.reverse allows some flexibility in implementation
- regarding array indices that have not been populated. This test covers the
- cases in which unpopulated indices are not deleted, since the JavaScript
- implementation does not delete uninitialzed indices.
-
- Author: christine@netscape.com
- Date: 7 october 1997
-*/
-
- var SECTION = "15.4.4.4-1";
- var VERSION = "ECMA_1";
- startTest();
- var testcases = new Array();
-
- writeHeaderToLog( SECTION + " Array.prototype.reverse()");
-
- getTestCases();
- test();
-
-function getTestCases() {
- var ARR_PROTOTYPE = Array.prototype;
-
- testcases[testcases.length] = new TestCase( SECTION, "Array.prototype.reverse.length", 0, Array.prototype.reverse.length );
- testcases[testcases.length] = new TestCase( SECTION, "delete Array.prototype.reverse.length", false, delete Array.prototype.reverse.length );
- testcases[testcases.length] = new TestCase( SECTION, "delete Array.prototype.reverse.length; Array.prototype.reverse.length", 0, eval("delete Array.prototype.reverse.length; Array.prototype.reverse.length") );
-
- // length of array is 0
- testcases[testcases.length] = new TestCase( SECTION,
- "var A = new Array(); A.reverse(); A.length",
- 0,
- eval("var A = new Array(); A.reverse(); A.length") );
- return ( testcases );
-}
-function CheckItems( R, A ) {
- for ( var i = 0; i < R.length; i++ ) {
- testcases[testcases.length] = new TestCase(
- SECTION,
- "A["+i+ "]",
- R[i],
- A[i] );
- }
-}
-function test() {
- for ( tc=0; tc < testcases.length; tc++ ) {
- testcases[tc].passed = writeTestCaseResult(
- testcases[tc].expect,
- testcases[tc].actual,
- testcases[tc].description +" = "+ testcases[tc].actual );
- testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
- }
- stopTest();
- return ( testcases );
-}
-function Object_1( value ) {
- this.array = value.split(",");
- this.length = this.array.length;
- for ( var i = 0; i < this.length; i++ ) {
- this[i] = eval(this.array[i]);
- }
- this.join = Array.prototype.reverse;
- this.getClass = Object.prototype.toString;
-}
-function Reverse( array ) {
- var r2 = array.length;
- var k = 0;
- var r3 = Math.floor( r2/2 );
- if ( r3 == k ) {
- return array;
- }
-
- for ( k = 0; k < r3; k++ ) {
- var r6 = r2 - k - 1;
-// var r7 = String( k );
- var r7 = k;
- var r8 = String( r6 );
-
- var r9 = array[r7];
- var r10 = array[r8];
-
- array[r7] = r10;
- array[r8] = r9;
- }
-
- return array;
-}
-function Iterate( array ) {
- for ( var i = 0; i < array.length; i++ ) {
-// print( i+": "+ array[String(i)] );
- }
-}
-
-function Object_1( value ) {
- this.array = value.split(",");
- this.length = this.array.length;
- for ( var i = 0; i < this.length; i++ ) {
- this[i] = this.array[i];
- }
- this.reverse = Array.prototype.reverse;
- this.getClass = Object.prototype.toString;
-}
diff --git a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.4.5-1.js b/JavaScriptCore/tests/mozilla/ecma/Array/15.4.4.5-1.js
deleted file mode 100644
index 0a759c3..0000000
--- a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.4.5-1.js
+++ /dev/null
@@ -1,223 +0,0 @@
-/* The contents of this file are subject to the Netscape Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/NPL/
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * The Original Code is Mozilla Communicator client code, released March
- * 31, 1998.
- *
- * The Initial Developer of the Original Code is Netscape Communications
- * Corporation. Portions created by Netscape are
- * Copyright (C) 1998 Netscape Communications Corporation. All
- * Rights Reserved.
- *
- * Contributor(s):
- *
- */
-/**
- File Name: 15.4.4.5.js
- ECMA Section: Array.prototype.sort(comparefn)
- Description:
-
- This test file tests cases in which the compare function is not supplied.
-
- The elements of this array are sorted. The sort is not necessarily stable.
- If comparefn is provided, it should be a function that accepts two arguments
- x and y and returns a negative value if x < y, zero if x = y, or a positive
- value if x > y.
-
- 1. Call the [[Get]] method of this object with argument "length".
- 2. Call ToUint32(Result(1)).
- 1. Perform an implementation-dependent sequence of calls to the
- [[Get]] , [[Put]], and [[Delete]] methods of this object and
- toSortCompare (described below), where the first argument for each call
- to [[Get]], [[Put]] , or [[Delete]] is a nonnegative integer less
- than Result(2) and where the arguments for calls to SortCompare are
- results of previous calls to the [[Get]] method. After this sequence
- is complete, this object must have the following two properties.
- (1) There must be some mathematical permutation of the nonnegative
- integers less than Result(2), such that for every nonnegative integer
- j less than Result(2), if property old[j] existed, then new[(j)] is
- exactly the same value as old[j],. but if property old[j] did not exist,
- then new[(j)] either does not exist or exists with value undefined.
- (2) If comparefn is not supplied or is a consistent comparison
- function for the elements of this array, then for all nonnegative
- integers j and k, each less than Result(2), if old[j] compares less
- than old[k] (see SortCompare below), then (j) < (k). Here we use the
- notation old[j] to refer to the hypothetical result of calling the [
- [Get]] method of this object with argument j before this step is
- executed, and the notation new[j] to refer to the hypothetical result
- of calling the [[Get]] method of this object with argument j after this
- step has been completely executed. A function is a consistent
- comparison function for a set of values if (a) for any two of those
- values (possibly the same value) considered as an ordered pair, it
- always returns the same value when given that pair of values as its
- two arguments, and the result of applying ToNumber to this value is
- not NaN; (b) when considered as a relation, where the pair (x, y) is
- considered to be in the relation if and only if applying the function
- to x and y and then applying ToNumber to the result produces a
- negative value, this relation is a partial order; and (c) when
- considered as a different relation, where the pair (x, y) is considered
- to be in the relation if and only if applying the function to x and y
- and then applying ToNumber to the result produces a zero value (of either
- sign), this relation is an equivalence relation. In this context, the
- phrase "x compares less than y" means applying Result(2) to x and y and
- then applying ToNumber to the result produces a negative value.
- 3.Return this object.
-
- When the SortCompare operator is called with two arguments x and y, the following steps are taken:
- 1.If x and y are both undefined, return +0.
- 2.If x is undefined, return 1.
- 3.If y is undefined, return 1.
- 4.If the argument comparefn was not provided in the call to sort, go to step 7.
- 5.Call comparefn with arguments x and y.
- 6.Return Result(5).
- 7.Call ToString(x).
- 8.Call ToString(y).
- 9.If Result(7) < Result(8), return 1.
- 10.If Result(7) > Result(8), return 1.
- 11.Return +0.
-
-Note that, because undefined always compared greater than any other value, undefined and nonexistent
-property values always sort to the end of the result. It is implementation-dependent whether or not such
-properties will exist or not at the end of the array when the sort is concluded.
-
-Note that the sort function is intentionally generic; it does not require that its this value be an Array object.
-Therefore it can be transferred to other kinds of objects for use as a method. Whether the sort function can be
-applied successfully to a host object is implementation dependent .
-
- Author: christine@netscape.com
- Date: 12 november 1997
-*/
-
-
- var SECTION = "15.4.4.5-1";
- var VERSION = "ECMA_1";
- startTest();
- var TITLE = "Array.prototype.sort(comparefn)";
-
- writeHeaderToLog( SECTION + " "+ TITLE);
-
- var testcases = new Array();
- getTestCases();
- test();
-
-function test() {
- for ( tc=0; tc < testcases.length; tc++ ) {
- testcases[tc].passed = writeTestCaseResult(
- testcases[tc].expect,
- testcases[tc].actual,
- testcases[tc].description +" = "+
- testcases[tc].actual );
-
- testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
- }
- stopTest();
- return ( testcases );
-}
-function getTestCases() {
- var S = new Array();
- var item = 0;
-
- // array is empty.
- S[item++] = "var A = new Array()";
-
- // array contains one item
- S[item++] = "var A = new Array( true )";
-
- // length of array is 2
- S[item++] = "var A = new Array( true, false, new Boolean(true), new Boolean(false), 'true', 'false' )";
-
- S[item++] = "var A = new Array(); A[3] = 'undefined'; A[6] = null; A[8] = 'null'; A[0] = void 0";
-
- S[item] = "var A = new Array( ";
-
- var limit = 0x0061;
- for ( var i = 0x007A; i >= limit; i-- ) {
- S[item] += "\'"+ String.fromCharCode(i) +"\'" ;
- if ( i > limit ) {
- S[item] += ",";
- }
- }
-
- S[item] += ")";
-
- item++;
-
- for ( var i = 0; i < S.length; i++ ) {
- CheckItems( S[i] );
- }
-}
-function CheckItems( S ) {
- eval( S );
- var E = Sort( A );
-
- testcases[testcases.length] = new TestCase( SECTION,
- S +"; A.sort(); A.length",
- E.length,
- eval( S + "; A.sort(); A.length") );
-
- for ( var i = 0; i < E.length; i++ ) {
- testcases[testcases.length] = new TestCase(
- SECTION,
- "A["+i+ "].toString()",
- E[i] +"",
- A[i] +"");
-
- if ( A[i] == void 0 && typeof A[i] == "undefined" ) {
- testcases[testcases.length] = new TestCase(
- SECTION,
- "typeof A["+i+ "]",
- typeof E[i],
- typeof A[i] );
- }
- }
-}
-function Object_1( value ) {
- this.array = value.split(",");
- this.length = this.array.length;
- for ( var i = 0; i < this.length; i++ ) {
- this[i] = eval(this.array[i]);
- }
- this.sort = Array.prototype.sort;
- this.getClass = Object.prototype.toString;
-}
-function Sort( a ) {
- for ( i = 0; i < a.length; i++ ) {
- for ( j = i+1; j < a.length; j++ ) {
- var lo = a[i];
- var hi = a[j];
- var c = Compare( lo, hi );
- if ( c == 1 ) {
- a[i] = hi;
- a[j] = lo;
- }
- }
- }
- return a;
-}
-function Compare( x, y ) {
- if ( x == void 0 && y == void 0 && typeof x == "undefined" && typeof y == "undefined" ) {
- return +0;
- }
- if ( x == void 0 && typeof x == "undefined" ) {
- return 1;
- }
- if ( y == void 0 && typeof y == "undefined" ) {
- return -1;
- }
- x = String(x);
- y = String(y);
- if ( x < y ) {
- return -1;
- }
- if ( x > y ) {
- return 1;
- }
- return 0;
-}
diff --git a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.4.5-2.js b/JavaScriptCore/tests/mozilla/ecma/Array/15.4.4.5-2.js
deleted file mode 100644
index 23e1eac..0000000
--- a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.4.5-2.js
+++ /dev/null
@@ -1,224 +0,0 @@
-/* The contents of this file are subject to the Netscape Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/NPL/
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * The Original Code is Mozilla Communicator client code, released March
- * 31, 1998.
- *
- * The Initial Developer of the Original Code is Netscape Communications
- * Corporation. Portions created by Netscape are
- * Copyright (C) 1998 Netscape Communications Corporation. All
- * Rights Reserved.
- *
- * Contributor(s):
- *
- */
-/**
- File Name: 15.4.4.5-2.js
- ECMA Section: Array.prototype.sort(comparefn)
- Description:
-
- This test file tests cases in which the compare function is supplied.
- In this cases, the sort creates a reverse sort.
-
- The elements of this array are sorted. The sort is not necessarily stable.
- If comparefn is provided, it should be a function that accepts two arguments
- x and y and returns a negative value if x < y, zero if x = y, or a positive
- value if x > y.
-
- 1. Call the [[Get]] method of this object with argument "length".
- 2. Call ToUint32(Result(1)).
- 1. Perform an implementation-dependent sequence of calls to the
- [[Get]] , [[Put]], and [[Delete]] methods of this object and
- toSortCompare (described below), where the first argument for each call
- to [[Get]], [[Put]] , or [[Delete]] is a nonnegative integer less
- than Result(2) and where the arguments for calls to SortCompare are
- results of previous calls to the [[Get]] method. After this sequence
- is complete, this object must have the following two properties.
- (1) There must be some mathematical permutation of the nonnegative
- integers less than Result(2), such that for every nonnegative integer
- j less than Result(2), if property old[j] existed, then new[(j)] is
- exactly the same value as old[j],. but if property old[j] did not exist,
- then new[(j)] either does not exist or exists with value undefined.
- (2) If comparefn is not supplied or is a consistent comparison
- function for the elements of this array, then for all nonnegative
- integers j and k, each less than Result(2), if old[j] compares less
- than old[k] (see SortCompare below), then (j) < (k). Here we use the
- notation old[j] to refer to the hypothetical result of calling the [
- [Get]] method of this object with argument j before this step is
- executed, and the notation new[j] to refer to the hypothetical result
- of calling the [[Get]] method of this object with argument j after this
- step has been completely executed. A function is a consistent
- comparison function for a set of values if (a) for any two of those
- values (possibly the same value) considered as an ordered pair, it
- always returns the same value when given that pair of values as its
- two arguments, and the result of applying ToNumber to this value is
- not NaN; (b) when considered as a relation, where the pair (x, y) is
- considered to be in the relation if and only if applying the function
- to x and y and then applying ToNumber to the result produces a
- negative value, this relation is a partial order; and (c) when
- considered as a different relation, where the pair (x, y) is considered
- to be in the relation if and only if applying the function to x and y
- and then applying ToNumber to the result produces a zero value (of either
- sign), this relation is an equivalence relation. In this context, the
- phrase "x compares less than y" means applying Result(2) to x and y and
- then applying ToNumber to the result produces a negative value.
- 3.Return this object.
-
- When the SortCompare operator is called with two arguments x and y, the following steps are taken:
- 1.If x and y are both undefined, return +0.
- 2.If x is undefined, return 1.
- 3.If y is undefined, return 1.
- 4.If the argument comparefn was not provided in the call to sort, go to step 7.
- 5.Call comparefn with arguments x and y.
- 6.Return Result(5).
- 7.Call ToString(x).
- 8.Call ToString(y).
- 9.If Result(7) < Result(8), return 1.
- 10.If Result(7) > Result(8), return 1.
- 11.Return +0.
-
-Note that, because undefined always compared greater than any other value, undefined and nonexistent
-property values always sort to the end of the result. It is implementation-dependent whether or not such
-properties will exist or not at the end of the array when the sort is concluded.
-
-Note that the sort function is intentionally generic; it does not require that its this value be an Array object.
-Therefore it can be transferred to other kinds of objects for use as a method. Whether the sort function can be
-applied successfully to a host object is implementation dependent .
-
- Author: christine@netscape.com
- Date: 12 november 1997
-*/
-
-
- var SECTION = "15.4.4.5-2";
- var VERSION = "ECMA_1";
- startTest();
- var TITLE = "Array.prototype.sort(comparefn)";
-
- writeHeaderToLog( SECTION + " "+ TITLE);
-
- var testcases = new Array();
- getTestCases();
- test();
-
-function test() {
- for ( tc=0; tc < testcases.length; tc++ ) {
- testcases[tc].passed = writeTestCaseResult(
- testcases[tc].expect,
- testcases[tc].actual,
- testcases[tc].description +" = "+
- testcases[tc].actual );
-
- testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
- }
- stopTest();
- return ( testcases );
-}
-function getTestCases() {
- var S = new Array();
- var item = 0;
-
- // array is empty.
- S[item++] = "var A = new Array()";
-
- // array contains one item
- S[item++] = "var A = new Array( true )";
-
- // length of array is 2
- S[item++] = "var A = new Array( true, false, new Boolean(true), new Boolean(false), 'true', 'false' )";
-
- S[item++] = "var A = new Array(); A[3] = 'undefined'; A[6] = null; A[8] = 'null'; A[0] = void 0";
-
- S[item] = "var A = new Array( ";
-
- var limit = 0x0061;
- for ( var i = 0x007A; i >= limit; i-- ) {
- S[item] += "\'"+ String.fromCharCode(i) +"\'" ;
- if ( i > limit ) {
- S[item] += ",";
- }
- }
-
- S[item] += ")";
-
- for ( var i = 0; i < S.length; i++ ) {
- CheckItems( S[i] );
- }
-
-}
-function CheckItems( S ) {
- eval( S );
- var E = Sort( A );
-
- testcases[testcases.length] = new TestCase( SECTION,
- S +"; A.sort(Compare); A.length",
- E.length,
- eval( S + "; A.sort(Compare); A.length") );
-
- for ( var i = 0; i < E.length; i++ ) {
- testcases[testcases.length] = new TestCase(
- SECTION,
- "A["+i+ "].toString()",
- E[i] +"",
- A[i] +"");
-
- if ( A[i] == void 0 && typeof A[i] == "undefined" ) {
- testcases[testcases.length] = new TestCase(
- SECTION,
- "typeof A["+i+ "]",
- typeof E[i],
- typeof A[i] );
- }
- }
-}
-function Object_1( value ) {
- this.array = value.split(",");
- this.length = this.array.length;
- for ( var i = 0; i < this.length; i++ ) {
- this[i] = eval(this.array[i]);
- }
- this.sort = Array.prototype.sort;
- this.getClass = Object.prototype.toString;
-}
-function Sort( a ) {
- var r1 = a.length;
- for ( i = 0; i < a.length; i++ ) {
- for ( j = i+1; j < a.length; j++ ) {
- var lo = a[i];
- var hi = a[j];
- var c = Compare( lo, hi );
- if ( c == 1 ) {
- a[i] = hi;
- a[j] = lo;
- }
- }
- }
- return a;
-}
-function Compare( x, y ) {
- if ( x == void 0 && y == void 0 && typeof x == "undefined" && typeof y == "undefined" ) {
- return +0;
- }
- if ( x == void 0 && typeof x == "undefined" ) {
- return 1;
- }
- if ( y == void 0 && typeof y == "undefined" ) {
- return -1;
- }
- x = String(x);
- y = String(y);
- if ( x < y ) {
- return 1;
- }
- if ( x > y ) {
- return -1;
- }
- return 0;
-}
diff --git a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.4.5-3.js b/JavaScriptCore/tests/mozilla/ecma/Array/15.4.4.5-3.js
deleted file mode 100644
index 47bbe5d..0000000
--- a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.4.5-3.js
+++ /dev/null
@@ -1,181 +0,0 @@
-/* The contents of this file are subject to the Netscape Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/NPL/
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * The Original Code is Mozilla Communicator client code, released March
- * 31, 1998.
- *
- * The Initial Developer of the Original Code is Netscape Communications
- * Corporation. Portions created by Netscape are
- * Copyright (C) 1998 Netscape Communications Corporation. All
- * Rights Reserved.
- *
- * Contributor(s):
- *
- */
-/**
- File Name: 15.4.4.5-3.js
- ECMA Section: Array.prototype.sort(comparefn)
- Description:
-
- This is a regression test for
- http://scopus/bugsplat/show_bug.cgi?id=117144
-
- Verify that sort is successfull, even if the sort compare function returns
- a very large negative or positive value.
-
- Author: christine@netscape.com
- Date: 12 november 1997
-*/
-
-
- var SECTION = "15.4.4.5-3";
- var VERSION = "ECMA_1";
- startTest();
- var TITLE = "Array.prototype.sort(comparefn)";
-
- writeHeaderToLog( SECTION + " "+ TITLE);
-
- var testcases = new Array();
- getTestCases();
- test();
-
-function test() {
- for ( tc=0; tc < testcases.length; tc++ ) {
- testcases[tc].passed = writeTestCaseResult(
- testcases[tc].expect,
- testcases[tc].actual,
- testcases[tc].description +" = "+
- testcases[tc].actual );
-
- testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
- }
- stopTest();
- return ( testcases );
-}
-
-function getTestCases() {
- var array = new Array();
-
- array[array.length] = new Date( TIME_2000 * Math.PI );
- array[array.length] = new Date( TIME_2000 * 10 );
- array[array.length] = new Date( TIME_1900 + TIME_1900 );
- array[array.length] = new Date(0);
- array[array.length] = new Date( TIME_2000 );
- array[array.length] = new Date( TIME_1900 + TIME_1900 +TIME_1900 );
- array[array.length] = new Date( TIME_1900 * Math.PI );
- array[array.length] = new Date( TIME_1900 * 10 );
- array[array.length] = new Date( TIME_1900 );
- array[array.length] = new Date( TIME_2000 + TIME_2000 );
- array[array.length] = new Date( 1899, 0, 1 );
- array[array.length] = new Date( 2000, 1, 29 );
- array[array.length] = new Date( 2000, 0, 1 );
- array[array.length] = new Date( 1999, 11, 31 );
-
- var testarr1 = new Array()
- clone( array, testarr1 );
- testarr1.sort( comparefn1 );
-
- var testarr2 = new Array()
- clone( array, testarr2 );
- testarr2.sort( comparefn2 );
-
- testarr3 = new Array();
- clone( array, testarr3 );
- testarr3.sort( comparefn3 );
-
- // when there's no sort function, sort sorts by the toString value of Date.
-
- var testarr4 = new Array()
- clone( array, testarr4 );
- testarr4.sort();
-
- var realarr = new Array();
- clone( array, realarr );
- realarr.sort( realsort );
-
- var stringarr = new Array();
- clone( array, stringarr );
- stringarr.sort( stringsort );
-
- for ( var i = 0, tc = 0; i < array.length; i++, tc++) {
- testcases[tc] = new TestCase(
- SECTION,
- "testarr1["+i+"]",
- realarr[i],
- testarr1[i] );
- }
-
- for ( var i=0; i < array.length; i++, tc++) {
- testcases[tc] = new TestCase(
- SECTION,
- "testarr2["+i+"]",
- realarr[i],
- testarr2[i] );
- }
-
- for ( var i=0; i < array.length; i++, tc++) {
- testcases[tc] = new TestCase(
- SECTION,
- "testarr3["+i+"]",
- realarr[i],
- testarr3[i] );
- }
-
- for ( var i=0; i < array.length; i++, tc++) {
- testcases[tc] = new TestCase(
- SECTION,
- "testarr4["+i+"]",
- stringarr[i].toString(),
- testarr4[i].toString() );
- }
-
-}
-function comparefn1( x, y ) {
- return x - y;
-}
-function comparefn2( x, y ) {
- return x.valueOf() - y.valueOf();
-}
-function realsort( x, y ) {
- return ( x.valueOf() == y.valueOf() ? 0 : ( x.valueOf() > y.valueOf() ? 1 : -1 ) );
-}
-function comparefn3( x, y ) {
- return ( +x == +y ? 0 : ( x > y ? 1 : -1 ) );
-}
-function clone( source, target ) {
- for (i = 0; i < source.length; i++ ) {
- target[i] = source[i];
- }
-}
-function stringsort( x, y ) {
- for ( var i = 0; i < x.toString().length; i++ ) {
- var d = (x.toString()).charCodeAt(i) - (y.toString()).charCodeAt(i);
- if ( d > 0 ) {
- return 1;
- } else {
- if ( d < 0 ) {
- return -1;
- } else {
- continue;
- }
- }
-
- var d = x.length - y.length;
-
- if ( d > 0 ) {
- return 1;
- } else {
- if ( d < 0 ) {
- return -1;
- }
- }
- }
- return 0;
-} \ No newline at end of file
diff --git a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.4.js b/JavaScriptCore/tests/mozilla/ecma/Array/15.4.4.js
deleted file mode 100644
index 4197dfb..0000000
--- a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.4.js
+++ /dev/null
@@ -1,77 +0,0 @@
-/* The contents of this file are subject to the Netscape Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/NPL/
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * The Original Code is Mozilla Communicator client code, released March
- * 31, 1998.
- *
- * The Initial Developer of the Original Code is Netscape Communications
- * Corporation. Portions created by Netscape are
- * Copyright (C) 1998 Netscape Communications Corporation. All
- * Rights Reserved.
- *
- * Contributor(s):
- *
- */
-/**
- File Name: 15.4.4.js
- ECMA Section: 15.4.4 Properties of the Array Prototype Object
- Description: The value of the internal [[Prototype]] property of
- the Array prototype object is the Object prototype
- object.
-
- Note that the Array prototype object is itself an
- array; it has a length property (whose initial value
- is (0) and the special [[Put]] method.
-
- Author: christine@netscape.com
- Date: 7 october 1997
-*/
-
- var SECTION = "15.4.4";
- var VERSION = "ECMA_1";
- startTest();
- var TITLE = "Properties of the Array Prototype Object";
-
- writeHeaderToLog( SECTION + " "+ TITLE);
-
- var testcases = getTestCases();
- test();
-
-function getTestCases() {
- var array = new Array();
- var item = 0;
-
-// these testcases are ECMA_2
-// array[item++] = new TestCase( SECTION, "Array.prototype.__proto__", Object.prototype, Array.prototype.__proto__ );
-// array[item++] = new TestCase( SECTION, "Array.__proto__.valueOf == Object.__proto__.valueOf", true, (Array.__proto__.valueOf == Object.__proto__.valueOf) );
-
- array[item++] = new TestCase( SECTION, "Array.prototype.length", 0, Array.prototype.length );
-
-// verify that prototype object is an Array object.
- array[item++] = new TestCase( SECTION, "typeof Array.prototype", "object", typeof Array.prototype );
-
- array[item++] = new TestCase( SECTION,
- "Array.prototype.toString = Object.prototype.toString; Array.prototype.toString()",
- "[object Array]",
- eval("Array.prototype.toString = Object.prototype.toString; Array.prototype.toString()") );
-
- return ( array );
-}
-function test() {
- for ( tc=0; tc < testcases.length; tc++ ) {
- testcases[tc].passed = writeTestCaseResult(
- testcases[tc].expect,
- testcases[tc].actual,
- testcases[tc].description +" = "+ testcases[tc].actual );
- testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
- }
- stopTest();
- return ( testcases );
-}
diff --git a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.5.1-1.js b/JavaScriptCore/tests/mozilla/ecma/Array/15.4.5.1-1.js
deleted file mode 100644
index e57408b..0000000
--- a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.5.1-1.js
+++ /dev/null
@@ -1,172 +0,0 @@
-/* The contents of this file are subject to the Netscape Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/NPL/
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * The Original Code is Mozilla Communicator client code, released March
- * 31, 1998.
- *
- * The Initial Developer of the Original Code is Netscape Communications
- * Corporation. Portions created by Netscape are
- * Copyright (C) 1998 Netscape Communications Corporation. All
- * Rights Reserved.
- *
- * Contributor(s):
- *
- */
-/**
- File Name: 15.4.5.1-1.js
- ECMA Section: [[ Put]] (P, V)
- Description:
- Array objects use a variation of the [[Put]] method used for other native
- ECMAScript objects (section 8.6.2.2).
-
- Assume A is an Array object and P is a string.
-
- When the [[Put]] method of A is called with property P and value V, the
- following steps are taken:
-
- 1. Call the [[CanPut]] method of A with name P.
- 2. If Result(1) is false, return.
- 3. If A doesn't have a property with name P, go to step 7.
- 4. If P is "length", go to step 12.
- 5. Set the value of property P of A to V.
- 6. Go to step 8.
- 7. Create a property with name P, set its value to V and give it empty
- attributes.
- 8. If P is not an array index, return.
- 9. If A itself has a property (not an inherited property) named "length",
- andToUint32(P) is less than the value of the length property of A, then
- return.
- 10. Change (or set) the value of the length property of A to ToUint32(P)+1.
- 11. Return.
- 12. Compute ToUint32(V).
- 13. For every integer k that is less than the value of the length property
- of A but not less than Result(12), if A itself has a property (not an
- inherited property) named ToString(k), then delete that property.
- 14. Set the value of property P of A to Result(12).
- 15. Return.
- Author: christine@netscape.com
- Date: 12 november 1997
-*/
-
- var SECTION = "15.4.5.1-1";
- var VERSION = "ECMA_1";
- startTest();
- var TITLE = "Array [[Put]] (P, V)";
-
- writeHeaderToLog( SECTION + " "+ TITLE);
-
- var testcases = getTestCases();
- test();
-
-function getTestCases() {
- var array = new Array();
-
- var item = 0;
-
- // P is "length"
-
- array[item++] = new TestCase( SECTION,
- "var A = new Array(); A.length = 1000; A.length",
- 1000,
- eval("var A = new Array(); A.length = 1000; A.length") );
-
- // A has Property P, and P is not length or an array index
- array[item++] = new TestCase( SECTION,
- "var A = new Array(1000); A.name = 'name of this array'; A.name",
- 'name of this array',
- eval("var A = new Array(1000); A.name = 'name of this array'; A.name") );
-
- array[item++] = new TestCase( SECTION,
- "var A = new Array(1000); A.name = 'name of this array'; A.length",
- 1000,
- eval("var A = new Array(1000); A.name = 'name of this array'; A.length") );
-
-
- // A has Property P, P is not length, P is an array index, and ToUint32(p) is less than the
- // value of length
-
- array[item++] = new TestCase( SECTION,
- "var A = new Array(1000); A[123] = 'hola'; A[123]",
- 'hola',
- eval("var A = new Array(1000); A[123] = 'hola'; A[123]") );
-
- array[item++] = new TestCase( SECTION,
- "var A = new Array(1000); A[123] = 'hola'; A.length",
- 1000,
- eval("var A = new Array(1000); A[123] = 'hola'; A.length") );
-
-
- for ( var i = 0X0020, TEST_STRING = "var A = new Array( " ; i < 0x00ff; i++ ) {
- TEST_STRING += "\'\\"+ String.fromCharCode( i ) +"\'";
- if ( i < 0x00FF - 1 ) {
- TEST_STRING += ",";
- } else {
- TEST_STRING += ");"
- }
- }
-
- var LENGTH = 0x00ff - 0x0020;
-
- array[item++] = new TestCase( SECTION,
- TEST_STRING +" A[150] = 'hello'; A[150]",
- 'hello',
- eval( TEST_STRING + " A[150] = 'hello'; A[150]" ) );
-
- array[item++] = new TestCase( SECTION,
- TEST_STRING +" A[150] = 'hello'; A[150]",
- LENGTH,
- eval( TEST_STRING + " A[150] = 'hello'; A.length" ) );
-
- // A has Property P, P is not length, P is an array index, and ToUint32(p) is not less than the
- // value of length
-
- array[item++] = new TestCase( SECTION,
- "var A = new Array(); A[123] = true; A.length",
- 124,
- eval("var A = new Array(); A[123] = true; A.length") );
-
- array[item++] = new TestCase( SECTION,
- "var A = new Array(0,1,2,3,4,5,6,7,8,9,10); A[15] ='15'; A.length",
- 16,
- eval("var A = new Array(0,1,2,3,4,5,6,7,8,9,10); A[15] ='15'; A.length") );
-
- for ( var i = 0; i < A.length; i++, item++ ) {
- array[item] = new TestCase( SECTION,
- "var A = new Array(0,1,2,3,4,5,6,7,8,9,10); A[15] ='15'; A[" +i +"]",
- (i <= 10) ? i : ( i == 15 ? '15' : void 0 ),
- A[i] );
- }
- // P is not an array index, and P is not "length"
-
- array[item++] = new TestCase( SECTION,
- "var A = new Array(); A.join.length = 4; A.join.length",
- 1,
- eval("var A = new Array(); A.join.length = 4; A.join.length") );
-
- array[item++] = new TestCase( SECTION,
- "var A = new Array(); A.join.length = 4; A.length",
- 0,
- eval("var A = new Array(); A.join.length = 4; A.length") );
-
- return array;
-}
-function test() {
- for ( tc=0; tc < testcases.length; tc++ ) {
- testcases[tc].passed = writeTestCaseResult(
- testcases[tc].expect,
- testcases[tc].actual,
- testcases[tc].description +" = "+
- testcases[tc].actual );
-
- testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
- }
- stopTest();
- return ( testcases );
-}
diff --git a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.5.1-2.js b/JavaScriptCore/tests/mozilla/ecma/Array/15.4.5.1-2.js
deleted file mode 100644
index 08b4721..0000000
--- a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.5.1-2.js
+++ /dev/null
@@ -1,150 +0,0 @@
-/* The contents of this file are subject to the Netscape Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/NPL/
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * The Original Code is Mozilla Communicator client code, released March
- * 31, 1998.
- *
- * The Initial Developer of the Original Code is Netscape Communications
- * Corporation. Portions created by Netscape are
- * Copyright (C) 1998 Netscape Communications Corporation. All
- * Rights Reserved.
- *
- * Contributor(s):
- *
- */
-/**
- File Name: 15.4.5.1-2.js
- ECMA Section: [[ Put]] (P, V)
- Description:
- Array objects use a variation of the [[Put]] method used for other native
- ECMAScript objects (section 8.6.2.2).
-
- Assume A is an Array object and P is a string.
-
- When the [[Put]] method of A is called with property P and value V, the
- following steps are taken:
-
- 1. Call the [[CanPut]] method of A with name P.
- 2. If Result(1) is false, return.
- 3. If A doesn't have a property with name P, go to step 7.
- 4. If P is "length", go to step 12.
- 5. Set the value of property P of A to V.
- 6. Go to step 8.
- 7. Create a property with name P, set its value to V and give it empty
- attributes.
- 8. If P is not an array index, return.
- 9. If A itself has a property (not an inherited property) named "length",
- andToUint32(P) is less than the value of the length property of A, then
- return.
- 10. Change (or set) the value of the length property of A to ToUint32(P)+1.
- 11. Return.
- 12. Compute ToUint32(V).
- 13. For every integer k that is less than the value of the length property
- of A but not less than Result(12), if A itself has a property (not an
- inherited property) named ToString(k), then delete that property.
- 14. Set the value of property P of A to Result(12).
- 15. Return.
-
-
- These are testcases from Waldemar, detailed in
- http://scopus.mcom.com/bugsplat/show_bug.cgi?id=123552
-
- Author: christine@netscape.com
- Date: 15 June 1998
-*/
-
- var SECTION = "15.4.5.1-2";
- var VERSION = "ECMA_1";
- startTest();
- var TITLE = "Array [[Put]] (P,V)";
-
- writeHeaderToLog( SECTION + " "+ TITLE);
-
- var testcases = new Array();
-
- var a = new Array();
-
- AddCase( "3.00", "three" );
- AddCase( "00010", "eight" );
- AddCase( "37xyz", "thirty-five" );
- AddCase("5000000000", 5)
- AddCase( "-2", -3 );
-
- testcases[tc++] = new TestCase( SECTION,
- "a[10]",
- void 0,
- a[10] );
-
- testcases[tc++] = new TestCase( SECTION,
- "a[3]",
- void 0,
- a[3] );
-
- a[4] = "four";
-
- testcases[tc++] = new TestCase( SECTION,
- "a[4] = \"four\"; a[4]",
- "four",
- a[4] );
-
- testcases[tc++] = new TestCase( SECTION,
- "a[\"4\"]",
- "four",
- a["4"] );
-
- testcases[tc++] = new TestCase( SECTION,
- "a[\"4.00\"]",
- void 0,
- a["4.00"] );
-
- testcases[tc++] = new TestCase( SECTION,
- "a.length",
- 5,
- a.length );
-
-
- a["5000000000"] = 5;
-
- testcases[tc++] = new TestCase( SECTION,
- "a[\"5000000000\"] = 5; a.length",
- 5,
- a.length );
-
- testcases[tc++] = new TestCase( SECTION,
- "a[\"-2\"] = -3; a.length",
- 5,
- a.length );
-
- test();
-
-function AddCase ( arg, value ) {
-
- a[arg] = value;
-
- testcases[tc++] = new TestCase( SECTION,
- "a[\"" + arg + "\"] = "+ value +"; a.length",
- 0,
- a.length );
-}
-
-
-function test() {
- for ( tc=0; tc < testcases.length; tc++ ) {
- testcases[tc].passed = writeTestCaseResult(
- testcases[tc].expect,
- testcases[tc].actual,
- testcases[tc].description +" = "+
- testcases[tc].actual );
-
- testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
- }
- stopTest();
- return ( testcases );
-}
diff --git a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.5.2-1.js b/JavaScriptCore/tests/mozilla/ecma/Array/15.4.5.2-1.js
deleted file mode 100644
index 069ae57..0000000
--- a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.5.2-1.js
+++ /dev/null
@@ -1,93 +0,0 @@
-/* The contents of this file are subject to the Netscape Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/NPL/
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * The Original Code is Mozilla Communicator client code, released March
- * 31, 1998.
- *
- * The Initial Developer of the Original Code is Netscape Communications
- * Corporation. Portions created by Netscape are
- * Copyright (C) 1998 Netscape Communications Corporation. All
- * Rights Reserved.
- *
- * Contributor(s):
- *
- */
-/**
- File Name: 15.4.5.2-1.js
- ECMA Section: Array.length
- Description:
- 15.4.5.2 length
- The length property of this Array object is always numerically greater
- than the name of every property whose name is an array index.
-
- The length property has the attributes { DontEnum, DontDelete }.
- Author: christine@netscape.com
- Date: 12 november 1997
-*/
-
- var SECTION = "15.4.5.2-1";
- var VERSION = "ECMA_1";
- startTest();
- var TITLE = "Array.length";
-
- writeHeaderToLog( SECTION + " "+ TITLE);
-
- var testcases = getTestCases();
- test();
-function getTestCases() {
- var array = new Array();
- var item = 0;
-
- array[item++] = new TestCase( SECTION,
- "var A = new Array(); A.length",
- 0,
- eval("var A = new Array(); A.length") );
-
- array[item++] = new TestCase( SECTION,
- "var A = new Array(); A[Math.pow(2,32)-2] = 'hi'; A.length",
- Math.pow(2,32)-1,
- eval("var A = new Array(); A[Math.pow(2,32)-2] = 'hi'; A.length") );
-
- array[item++] = new TestCase( SECTION,
- "var A = new Array(); A.length = 123; A.length",
- 123,
- eval("var A = new Array(); A.length = 123; A.length") );
-
- array[item++] = new TestCase( SECTION,
- "var A = new Array(); A.length = 123; var PROPS = ''; for ( var p in A ) { PROPS += ( p == 'length' ? p : ''); } PROPS",
- "",
- eval("var A = new Array(); A.length = 123; var PROPS = ''; for ( var p in A ) { PROPS += ( p == 'length' ? p : ''); } PROPS") );
-
-
- array[item++] = new TestCase( SECTION,
- "var A = new Array(); A.length = 123; delete A.length",
- false ,
- eval("var A = new Array(); A.length = 123; delete A.length") );
-
- array[item++] = new TestCase( SECTION,
- "var A = new Array(); A.length = 123; delete A.length; A.length",
- 123,
- eval("var A = new Array(); A.length = 123; delete A.length; A.length") );
- return array;
-}
-
-function test() {
- for ( tc=0; tc < testcases.length; tc++ ) {
- testcases[tc].passed = writeTestCaseResult(
- testcases[tc].expect,
- testcases[tc].actual,
- testcases[tc].description +" = "+
- testcases[tc].actual );
-
- testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
- }
- stopTest();
- return ( testcases );
-}
diff --git a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.5.2-2.js b/JavaScriptCore/tests/mozilla/ecma/Array/15.4.5.2-2.js
deleted file mode 100644
index 9d65b2c..0000000
--- a/JavaScriptCore/tests/mozilla/ecma/Array/15.4.5.2-2.js
+++ /dev/null
@@ -1,123 +0,0 @@
-/* The contents of this file are subject to the Netscape Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/NPL/
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * The Original Code is Mozilla Communicator client code, released March
- * 31, 1998.
- *
- * The Initial Developer of the Original Code is Netscape Communications
- * Corporation. Portions created by Netscape are
- * Copyright (C) 1998 Netscape Communications Corporation. All
- * Rights Reserved.
- *
- * Contributor(s):
- *
- */
-/**
- File Name: 15.4.5.2-2.js
- ECMA Section: Array.length
- Description:
- 15.4.5.2 length
- The length property of this Array object is always numerically greater
- than the name of every property whose name is an array index.
-
- The length property has the attributes { DontEnum, DontDelete }.
-
- This test verifies that the Array.length property is not Read Only.
-
- Author: christine@netscape.com
- Date: 12 november 1997
-*/
-
- var SECTION = "15.4.5.2-2";
- var VERSION = "ECMA_1";
- startTest();
- var TITLE = "Array.length";
-
- writeHeaderToLog( SECTION + " "+ TITLE);
-
- var testcases = new Array();
-
- addCase( new Array(), 0, Math.pow(2,14), Math.pow(2,14) );
-
- addCase( new Array(), 0, 1, 1 );
-
- addCase( new Array(Math.pow(2,12)), Math.pow(2,12), 0, 0 );
- addCase( new Array(Math.pow(2,13)), Math.pow(2,13), Math.pow(2,12), Math.pow(2,12) );
- addCase( new Array(Math.pow(2,12)), Math.pow(2,12), Math.pow(2,12), Math.pow(2,12) );
- addCase( new Array(Math.pow(2,14)), Math.pow(2,14), Math.pow(2,12), Math.pow(2,12) )
-
- // some tests where array is not empty
- // array is populated with strings
- for ( var arg = "", i = 0; i < Math.pow(2,12); i++ ) {
- arg += String(i) + ( i != Math.pow(2,12)-1 ? "," : "" );
-
- }
-// print(i +":"+arg);
-
- var a = eval( "new Array("+arg+")" );
-
- addCase( a, i, i, i );
- addCase( a, i, Math.pow(2,12)+i+1, Math.pow(2,12)+i+1, true );
- addCase( a, Math.pow(2,12)+5, 0, 0, true );
-
- test();
-
-function addCase( object, old_len, set_len, new_len, checkitems ) {
- object.length = set_len;
-
- testcases[testcases.length] = new TestCase( SECTION,
- "array = new Array("+ old_len+"); array.length = " + set_len +
- "; array.length",
- new_len,
- object.length );
-
- if ( checkitems ) {
- // verify that items between old and newlen are all undefined
- if ( new_len < old_len ) {
- var passed = true;
- for ( var i = new_len; i < old_len; i++ ) {
- if ( object[i] != void 0 ) {
- passed = false;
- }
- }
- testcases[testcases.length] = new TestCase( SECTION,
- "verify that array items have been deleted",
- true,
- passed );
- }
- if ( new_len > old_len ) {
- var passed = true;
- for ( var i = old_len; i < new_len; i++ ) {
- if ( object[i] != void 0 ) {
- passed = false;
- }
- }
- testcases[testcases.length] = new TestCase( SECTION,
- "verify that new items are undefined",
- true,
- passed );
- }
- }
-
-}
-
-function test() {
- for ( tc=0; tc < testcases.length; tc++ ) {
- testcases[tc].passed = writeTestCaseResult(
- testcases[tc].expect,
- testcases[tc].actual,
- testcases[tc].description +" = "+
- testcases[tc].actual );
-
- testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
- }
- stopTest();
- return ( testcases );
-}