diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 18:28:41 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 18:28:41 -0800 |
commit | 648161bb0edfc3d43db63caed5cc5213bc6cb78f (patch) | |
tree | 4b825dc642cb6eb9a060e54bf8d69288fbee4904 /JavaScriptCore/tests/mozilla/ecma/Expressions | |
parent | a65af38181ac7d34544586bdb5cd004de93897ad (diff) | |
download | external_webkit-648161bb0edfc3d43db63caed5cc5213bc6cb78f.zip external_webkit-648161bb0edfc3d43db63caed5cc5213bc6cb78f.tar.gz external_webkit-648161bb0edfc3d43db63caed5cc5213bc6cb78f.tar.bz2 |
auto import from //depot/cupcake/@135843
Diffstat (limited to 'JavaScriptCore/tests/mozilla/ecma/Expressions')
66 files changed, 0 insertions, 9044 deletions
diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.1.1.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.1.1.js deleted file mode 100644 index 5801961..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.1.1.js +++ /dev/null @@ -1,135 +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: 11.1.1.js - ECMA Section: 11.1.1 The this keyword - Description: - - The this keyword evaluates to the this value of the execution context. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.1.1"; - var VERSION = "ECMA_1"; - startTest(); - - writeHeaderToLog( SECTION + " The this keyword"); - - var testcases = new Array(); - var item = 0; - - var GLOBAL_OBJECT = this.toString(); - - // this in global code and eval(this) in global code should return the global object. - - testcases[item++] = new TestCase( SECTION, - "Global Code: this.toString()", - GLOBAL_OBJECT, - this.toString() ); - - testcases[item++] = new TestCase( SECTION, - "Global Code: eval('this.toString()')", - GLOBAL_OBJECT, - eval('this.toString()') ); - - // this in anonymous code called as a function should return the global object. - - testcases[item++] = new TestCase( SECTION, - "Anonymous Code: var MYFUNC = new Function('return this.toString()'); MYFUNC()", - GLOBAL_OBJECT, - eval("var MYFUNC = new Function('return this.toString()'); MYFUNC()") ); - - // eval( this ) in anonymous code called as a function should return that function's activation object - - testcases[item++] = new TestCase( SECTION, - "Anonymous Code: var MYFUNC = new Function('return (eval(\"this.toString()\")'); (MYFUNC()).toString()", - GLOBAL_OBJECT, - eval("var MYFUNC = new Function('return eval(\"this.toString()\")'); (MYFUNC()).toString()") ); - - // this and eval( this ) in anonymous code called as a constructor should return the object - - testcases[item++] = new TestCase( SECTION, - "Anonymous Code: var MYFUNC = new Function('this.THIS = this'); ((new MYFUNC()).THIS).toString()", - "[object Object]", - eval("var MYFUNC = new Function('this.THIS = this'); ((new MYFUNC()).THIS).toString()") ); - - testcases[item++] = new TestCase( SECTION, - "Anonymous Code: var MYFUNC = new Function('this.THIS = this'); var FUN1 = new MYFUNC(); FUN1.THIS == FUN1", - true, - eval("var MYFUNC = new Function('this.THIS = this'); var FUN1 = new MYFUNC(); FUN1.THIS == FUN1") ); - - testcases[item++] = new TestCase( SECTION, - "Anonymous Code: var MYFUNC = new Function('this.THIS = eval(\"this\")'); ((new MYFUNC().THIS).toString()", - "[object Object]", - eval("var MYFUNC = new Function('this.THIS = eval(\"this\")'); ((new MYFUNC()).THIS).toString()") ); - - testcases[item++] = new TestCase( SECTION, - "Anonymous Code: var MYFUNC = new Function('this.THIS = eval(\"this\")'); var FUN1 = new MYFUNC(); FUN1.THIS == FUN1", - true, - eval("var MYFUNC = new Function('this.THIS = eval(\"this\")'); var FUN1 = new MYFUNC(); FUN1.THIS == FUN1") ); - - // this and eval(this) in function code called as a function should return the global object. - testcases[item++] = new TestCase( SECTION, - "Function Code: ReturnThis()", - GLOBAL_OBJECT, - ReturnThis() ); - - testcases[item++] = new TestCase( SECTION, - "Function Code: ReturnEvalThis()", - GLOBAL_OBJECT, - ReturnEvalThis() ); - - // this and eval(this) in function code called as a contructor should return the object. - testcases[item++] = new TestCase( SECTION, - "var MYOBJECT = new ReturnThis(); MYOBJECT.toString()", - "[object Object]", - eval("var MYOBJECT = new ReturnThis(); MYOBJECT.toString()") ); - - testcases[item++] = new TestCase( SECTION, - "var MYOBJECT = new ReturnEvalThis(); MYOBJECT.toString()", - "[object Object]", - eval("var MYOBJECT = new ReturnEvalThis(); MYOBJECT.toString()") ); - - - - 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 ReturnThis() { - return this.toString(); -} -function ReturnEvalThis() { - return( eval("this.toString()") ); -}
\ No newline at end of file diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.10-1.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.10-1.js deleted file mode 100644 index c5f6911..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.10-1.js +++ /dev/null @@ -1,270 +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: 11.10-1.js - ECMA Section: 11.10-1 Binary Bitwise Operators: & - Description: - Semantics - - The production A : A @ B, where @ is one of the bitwise operators in the - productions &, ^, | , is evaluated as follows: - - 1. Evaluate A. - 2. Call GetValue(Result(1)). - 3. Evaluate B. - 4. Call GetValue(Result(3)). - 5. Call ToInt32(Result(2)). - 6. Call ToInt32(Result(4)). - 7. Apply the bitwise operator @ to Result(5) and Result(6). The result is - a signed 32 bit integer. - 8. Return Result(7). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.10-1"; - var VERSION = "ECMA_1"; - startTest(); - - var testcases = getTestCases(); - - writeHeaderToLog( SECTION + " Binary Bitwise Operators: &"); - 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(); - var item = 0; - var shiftexp = 0; - var addexp = 0; - -// for ( shiftpow = 0; shiftpow < 33; shiftpow++ ) { - for ( shiftpow = 0; shiftpow < 1; shiftpow++ ) { - shiftexp += Math.pow( 2, shiftpow ); - - for ( addpow = 0; addpow < 33; addpow++ ) { - addexp += Math.pow(2, addpow); - - array[item++] = new TestCase( SECTION, - shiftexp + " & " + addexp, - And( shiftexp, addexp ), - shiftexp & addexp ); - } - } - - return ( array ); -} -function ToInteger( n ) { - n = Number( n ); - var sign = ( n < 0 ) ? -1 : 1; - - if ( n != n ) { - return 0; - } - if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY ) { - return n; - } - return ( sign * Math.floor(Math.abs(n)) ); -} -function ToInt32( 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) )) % Math.pow(2,32); - n = ( n >= Math.pow(2,31) ) ? n - Math.pow(2,32) : n; - - return ( n ); -} -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 ); -} -function ToUint16( 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) ) ) % Math.pow(2,16); - - if (n <0) { - n += Math.pow(2,16); - } - - return ( n ); -} -function Mask( b, n ) { - b = ToUint32BitString( b ); - b = b.substring( b.length - n ); - b = ToUint32Decimal( b ); - return ( b ); -} -function ToUint32BitString( n ) { - var b = ""; - for ( p = 31; p >=0; p-- ) { - if ( n >= Math.pow(2,p) ) { - b += "1"; - n -= Math.pow(2,p); - } else { - b += "0"; - } - } - return b; -} -function ToInt32BitString( n ) { - var b = ""; - var sign = ( n < 0 ) ? -1 : 1; - - b += ( sign == 1 ) ? "0" : "1"; - - for ( p = 30; p >=0; p-- ) { - if ( (sign == 1 ) ? sign * n >= Math.pow(2,p) : sign * n > Math.pow(2,p) ) { - b += ( sign == 1 ) ? "1" : "0"; - n -= sign * Math.pow( 2, p ); - } else { - b += ( sign == 1 ) ? "0" : "1"; - } - } - - return b; -} -function ToInt32Decimal( bin ) { - var r = 0; - var sign; - - if ( Number(bin.charAt(0)) == 0 ) { - sign = 1; - r = 0; - } else { - sign = -1; - r = -(Math.pow(2,31)); - } - - for ( var j = 0; j < 31; j++ ) { - r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); - } - - return r; -} -function ToUint32Decimal( bin ) { - var r = 0; - - - for ( l = bin.length; l < 32; l++ ) { - bin = "0" + bin; - } - - for ( j = 0; j < 31; j++ ) { - r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); - - } - - return r; -} -function And( s, a ) { - s = ToInt32( s ); - a = ToInt32( a ); - - var bs = ToInt32BitString( s ); - var ba = ToInt32BitString( a ); - - var result = ""; - - for ( var bit = 0; bit < bs.length; bit++ ) { - if ( bs.charAt(bit) == "1" && ba.charAt(bit) == "1" ) { - result += "1"; - } else { - result += "0"; - } - } - return ToInt32Decimal(result); -} -function Xor( s, a ) { - s = ToInt32( s ); - a = ToInt32( a ); - - var bs = ToInt32BitString( s ); - var ba = ToInt32BitString( a ); - - var result = ""; - - for ( var bit = 0; bit < bs.length; bit++ ) { - if ( (bs.charAt(bit) == "1" && ba.charAt(bit) == "0") || - (bs.charAt(bit) == "0" && ba.charAt(bit) == "1") - ) { - result += "1"; - } else { - result += "0"; - } - } - - return ToInt32Decimal(result); -} -function Or( s, a ) { - s = ToInt32( s ); - a = ToInt32( a ); - - var bs = ToInt32BitString( s ); - var ba = ToInt32BitString( a ); - - var result = ""; - - for ( var bit = 0; bit < bs.length; bit++ ) { - if ( bs.charAt(bit) == "1" || ba.charAt(bit) == "1" ) { - result += "1"; - } else { - result += "0"; - } - } - - return ToInt32Decimal(result); -} diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.10-2.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.10-2.js deleted file mode 100644 index fc2e10e..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.10-2.js +++ /dev/null @@ -1,269 +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: 11.10-2.js - ECMA Section: 11.10-2 Binary Bitwise Operators: | - Description: - Semantics - - The production A : A @ B, where @ is one of the bitwise operators in the - productions &, ^, | , is evaluated as follows: - - 1. Evaluate A. - 2. Call GetValue(Result(1)). - 3. Evaluate B. - 4. Call GetValue(Result(3)). - 5. Call ToInt32(Result(2)). - 6. Call ToInt32(Result(4)). - 7. Apply the bitwise operator @ to Result(5) and Result(6). The result is - a signed 32 bit integer. - 8. Return Result(7). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.10-2"; - var VERSION = "ECMA_1"; - startTest(); - - var testcases = getTestCases(); - - writeHeaderToLog( SECTION + " Binary Bitwise Operators: |"); - 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(); - var item = 0; - var shiftexp = 0; - var addexp = 0; - - for ( shiftpow = 0; shiftpow < 33; shiftpow++ ) { - shiftexp += Math.pow( 2, shiftpow ); - - for ( addpow = 0; addpow < 33; addpow++ ) { - addexp += Math.pow(2, addpow); - - array[item++] = new TestCase( SECTION, - shiftexp + " | " + addexp, - Or( shiftexp, addexp ), - shiftexp | addexp ); - } - } - - return ( array ); -} -function ToInteger( n ) { - n = Number( n ); - var sign = ( n < 0 ) ? -1 : 1; - - if ( n != n ) { - return 0; - } - if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY ) { - return n; - } - return ( sign * Math.floor(Math.abs(n)) ); -} -function ToInt32( 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) )) % Math.pow(2,32); - n = ( n >= Math.pow(2,31) ) ? n - Math.pow(2,32) : n; - - return ( n ); -} -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 ); -} -function ToUint16( 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) ) ) % Math.pow(2,16); - - if (n <0) { - n += Math.pow(2,16); - } - - return ( n ); -} -function Mask( b, n ) { - b = ToUint32BitString( b ); - b = b.substring( b.length - n ); - b = ToUint32Decimal( b ); - return ( b ); -} -function ToUint32BitString( n ) { - var b = ""; - for ( p = 31; p >=0; p-- ) { - if ( n >= Math.pow(2,p) ) { - b += "1"; - n -= Math.pow(2,p); - } else { - b += "0"; - } - } - return b; -} -function ToInt32BitString( n ) { - var b = ""; - var sign = ( n < 0 ) ? -1 : 1; - - b += ( sign == 1 ) ? "0" : "1"; - - for ( p = 30; p >=0; p-- ) { - if ( (sign == 1 ) ? sign * n >= Math.pow(2,p) : sign * n > Math.pow(2,p) ) { - b += ( sign == 1 ) ? "1" : "0"; - n -= sign * Math.pow( 2, p ); - } else { - b += ( sign == 1 ) ? "0" : "1"; - } - } - - return b; -} -function ToInt32Decimal( bin ) { - var r = 0; - var sign; - - if ( Number(bin.charAt(0)) == 0 ) { - sign = 1; - r = 0; - } else { - sign = -1; - r = -(Math.pow(2,31)); - } - - for ( var j = 0; j < 31; j++ ) { - r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); - } - - return r; -} -function ToUint32Decimal( bin ) { - var r = 0; - - - for ( l = bin.length; l < 32; l++ ) { - bin = "0" + bin; - } - - for ( j = 0; j < 31; j++ ) { - r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); - - } - - return r; -} -function And( s, a ) { - s = ToInt32( s ); - a = ToInt32( a ); - - var bs = ToInt32BitString( s ); - var ba = ToInt32BitString( a ); - - var result = ""; - - for ( var bit = 0; bit < bs.length; bit++ ) { - if ( bs.charAt(bit) == "1" && ba.charAt(bit) == "1" ) { - result += "1"; - } else { - result += "0"; - } - } - return ToInt32Decimal(result); -} -function Xor( s, a ) { - s = ToInt32( s ); - a = ToInt32( a ); - - var bs = ToInt32BitString( s ); - var ba = ToInt32BitString( a ); - - var result = ""; - - for ( var bit = 0; bit < bs.length; bit++ ) { - if ( (bs.charAt(bit) == "1" && ba.charAt(bit) == "0") || - (bs.charAt(bit) == "0" && ba.charAt(bit) == "1") - ) { - result += "1"; - } else { - result += "0"; - } - } - - return ToInt32Decimal(result); -} -function Or( s, a ) { - s = ToInt32( s ); - a = ToInt32( a ); - - var bs = ToInt32BitString( s ); - var ba = ToInt32BitString( a ); - - var result = ""; - - for ( var bit = 0; bit < bs.length; bit++ ) { - if ( bs.charAt(bit) == "1" || ba.charAt(bit) == "1" ) { - result += "1"; - } else { - result += "0"; - } - } - - return ToInt32Decimal(result); -} diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.10-3.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.10-3.js deleted file mode 100644 index 0d55357..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.10-3.js +++ /dev/null @@ -1,268 +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: 11.10-3.js - ECMA Section: 11.10-3 Binary Bitwise Operators: ^ - Description: - Semantics - - The production A : A @ B, where @ is one of the bitwise operators in the - productions &, ^, | , is evaluated as follows: - - 1. Evaluate A. - 2. Call GetValue(Result(1)). - 3. Evaluate B. - 4. Call GetValue(Result(3)). - 5. Call ToInt32(Result(2)). - 6. Call ToInt32(Result(4)). - 7. Apply the bitwise operator @ to Result(5) and Result(6). The result is - a signed 32 bit integer. - 8. Return Result(7). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.10-3"; - var VERSION = "ECMA_1"; - startTest(); - - var testcases = getTestCases(); - - writeHeaderToLog( SECTION + " Binary Bitwise Operators: ^"); - 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(); - var item = 0; - var shiftexp = 0; - var addexp = 0; - - for ( shiftpow = 0; shiftpow < 33; shiftpow++ ) { - shiftexp += Math.pow( 2, shiftpow ); - - for ( addpow = 0; addpow < 33; addpow++ ) { - addexp += Math.pow(2, addpow); - - array[item++] = new TestCase( SECTION, - shiftexp + " ^ " + addexp, - Xor( shiftexp, addexp ), - shiftexp ^ addexp ); - } - } - - return ( array ); -} -function ToInteger( n ) { - n = Number( n ); - var sign = ( n < 0 ) ? -1 : 1; - - if ( n != n ) { - return 0; - } - if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY ) { - return n; - } - return ( sign * Math.floor(Math.abs(n)) ); -} -function ToInt32( 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) )) % Math.pow(2,32); - n = ( n >= Math.pow(2,31) ) ? n - Math.pow(2,32) : n; - - return ( n ); -} -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 ); -} -function ToUint16( 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) ) ) % Math.pow(2,16); - - if (n <0) { - n += Math.pow(2,16); - } - - return ( n ); -} -function Mask( b, n ) { - b = ToUint32BitString( b ); - b = b.substring( b.length - n ); - b = ToUint32Decimal( b ); - return ( b ); -} -function ToUint32BitString( n ) { - var b = ""; - for ( p = 31; p >=0; p-- ) { - if ( n >= Math.pow(2,p) ) { - b += "1"; - n -= Math.pow(2,p); - } else { - b += "0"; - } - } - return b; -} -function ToInt32BitString( n ) { - var b = ""; - var sign = ( n < 0 ) ? -1 : 1; - - b += ( sign == 1 ) ? "0" : "1"; - - for ( p = 30; p >=0; p-- ) { - if ( (sign == 1 ) ? sign * n >= Math.pow(2,p) : sign * n > Math.pow(2,p) ) { - b += ( sign == 1 ) ? "1" : "0"; - n -= sign * Math.pow( 2, p ); - } else { - b += ( sign == 1 ) ? "0" : "1"; - } - } - - return b; -} -function ToInt32Decimal( bin ) { - var r = 0; - var sign; - - if ( Number(bin.charAt(0)) == 0 ) { - sign = 1; - r = 0; - } else { - sign = -1; - r = -(Math.pow(2,31)); - } - - for ( var j = 0; j < 31; j++ ) { - r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); - } - - return r; -} -function ToUint32Decimal( bin ) { - var r = 0; - - for ( l = bin.length; l < 32; l++ ) { - bin = "0" + bin; - } - - for ( j = 0; j < 31; j++ ) { - r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); - - } - - return r; -} -function And( s, a ) { - s = ToInt32( s ); - a = ToInt32( a ); - - var bs = ToInt32BitString( s ); - var ba = ToInt32BitString( a ); - - var result = ""; - - for ( var bit = 0; bit < bs.length; bit++ ) { - if ( bs.charAt(bit) == "1" && ba.charAt(bit) == "1" ) { - result += "1"; - } else { - result += "0"; - } - } - return ToInt32Decimal(result); -} -function Xor( s, a ) { - s = ToInt32( s ); - a = ToInt32( a ); - - var bs = ToInt32BitString( s ); - var ba = ToInt32BitString( a ); - - var result = ""; - - for ( var bit = 0; bit < bs.length; bit++ ) { - if ( (bs.charAt(bit) == "1" && ba.charAt(bit) == "0") || - (bs.charAt(bit) == "0" && ba.charAt(bit) == "1") - ) { - result += "1"; - } else { - result += "0"; - } - } - - return ToInt32Decimal(result); -} -function Or( s, a ) { - s = ToInt32( s ); - a = ToInt32( a ); - - var bs = ToInt32BitString( s ); - var ba = ToInt32BitString( a ); - - var result = ""; - - for ( var bit = 0; bit < bs.length; bit++ ) { - if ( bs.charAt(bit) == "1" || ba.charAt(bit) == "1" ) { - result += "1"; - } else { - result += "0"; - } - } - - return ToInt32Decimal(result); -} diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.12-1.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.12-1.js deleted file mode 100644 index ae0a263..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.12-1.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: 11.12.js - ECMA Section: 11.12 Conditional Operator - Description: - Logi - - calORExpression ? AssignmentExpression : AssignmentExpression - - Semantics - - The production ConditionalExpression : - LogicalORExpression ? AssignmentExpression : AssignmentExpression - is evaluated as follows: - - 1. Evaluate LogicalORExpression. - 2. Call GetValue(Result(1)). - 3. Call ToBoolean(Result(2)). - 4. If Result(3) is false, go to step 8. - 5. Evaluate the first AssignmentExpression. - 6. Call GetValue(Result(5)). - 7. Return Result(6). - 8. Evaluate the second AssignmentExpression. - 9. Call GetValue(Result(8)). - 10. Return Result(9). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.12"; - var VERSION = "ECMA_1"; - startTest(); - var testcases = getTestCases(); - - writeHeaderToLog( SECTION + " Conditional operator( ? : )"); - test(); -function getTestCases() { - var array = new Array(); - var item = 0; - - array[item++] = new TestCase( SECTION, "true ? 'PASSED' : 'FAILED'", "PASSED", (true?"PASSED":"FAILED")); - array[item++] = new TestCase( SECTION, "false ? 'FAILED' : 'PASSED'", "PASSED", (false?"FAILED":"PASSED")); - - array[item++] = new TestCase( SECTION, "1 ? 'PASSED' : 'FAILED'", "PASSED", (true?"PASSED":"FAILED")); - array[item++] = new TestCase( SECTION, "0 ? 'FAILED' : 'PASSED'", "PASSED", (false?"FAILED":"PASSED")); - array[item++] = new TestCase( SECTION, "-1 ? 'PASSED' : 'FAILED'", "PASSED", (true?"PASSED":"FAILED")); - - array[item++] = new TestCase( SECTION, "NaN ? 'FAILED' : 'PASSED'", "PASSED", (Number.NaN?"FAILED":"PASSED")); - - array[item++] = new TestCase( SECTION, "var VAR = true ? , : 'FAILED'", "PASSED", (VAR = true ? "PASSED" : "FAILED") ); - - 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/Expressions/11.12-2-n.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.12-2-n.js deleted file mode 100644 index 05e42dc..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.12-2-n.js +++ /dev/null @@ -1,71 +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: 11.12-2-n.js - ECMA Section: 11.12 - Description: - - The grammar for a ConditionalExpression in ECMAScript is a little bit - different from that in C and Java, which each allow the second - subexpression to be an Expression but restrict the third expression to - be a ConditionalExpression. The motivation for this difference in - ECMAScript is to allow an assignment expression to be governed by either - arm of a conditional and to eliminate the confusing and fairly useless - case of a comma expression as the center expression. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - - var SECTION = "11.12-2-n"; - var VERSION = "ECMA_1"; - startTest(); - writeHeaderToLog( SECTION + " Conditional operator ( ? : )"); - - var testcases = new Array(); - - // the following expression should be an error in JS. - - testcases[tc] = new TestCase( SECTION, - "var MYVAR = true ? 'EXPR1', 'EXPR2' : 'EXPR3'; MYVAR", - "error", - "var MYVAR = true ? 'EXPR1', 'EXPR2' : 'EXPR3'; MYVAR" ); - - // get around parse time error by putting expression in an eval statement - - testcases[tc].actual = eval ( testcases[tc].actual ); - - 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 ); -} diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.12-3.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.12-3.js deleted file mode 100644 index eb79c16..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.12-3.js +++ /dev/null @@ -1,71 +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: 11.12-3.js - ECMA Section: 11.12 - Description: - - The grammar for a ConditionalExpression in ECMAScript is a little bit - different from that in C and Java, which each allow the second - subexpression to be an Expression but restrict the third expression to - be a ConditionalExpression. The motivation for this difference in - ECMAScript is to allow an assignment expression to be governed by either - arm of a conditional and to eliminate the confusing and fairly useless - case of a comma expression as the center expression. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - - var SECTION = "11.12-3"; - var VERSION = "ECMA_1"; - startTest(); - writeHeaderToLog( SECTION + " Conditional operator ( ? : )"); - - var testcases = new Array(); - - // the following expression should NOT be an error in JS. - - testcases[tc] = new TestCase( SECTION, - "var MYVAR = true ? ('FAIL1', 'PASSED') : 'FAIL2'; MYVAR", - "PASSED", - "var MYVAR = true ? ('FAIL1', 'PASSED') : 'FAIL2'; MYVAR" ); - - // get around potential parse time error by putting expression in an eval statement - - testcases[tc].actual = eval ( testcases[tc].actual ); - - 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 ); -} diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.12-4.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.12-4.js deleted file mode 100644 index 017cf4b..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.12-4.js +++ /dev/null @@ -1,71 +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: 11.12-4.js - ECMA Section: 11.12 - Description: - - The grammar for a ConditionalExpression in ECMAScript is a little bit - different from that in C and Java, which each allow the second - subexpression to be an Expression but restrict the third expression to - be a ConditionalExpression. The motivation for this difference in - ECMAScript is to allow an assignment expression to be governed by either - arm of a conditional and to eliminate the confusing and fairly useless - case of a comma expression as the center expression. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - - var SECTION = "11.12-4"; - var VERSION = "ECMA_1"; - startTest(); - writeHeaderToLog( SECTION + " Conditional operator ( ? : )"); - - var testcases = new Array(); - - // the following expression should NOT be an error in JS. - - testcases[tc] = new TestCase( SECTION, - "true ? MYVAR1 = 'PASSED' : MYVAR1 = 'FAILED'; MYVAR1", - "PASSED", - "true ? MYVAR1 = 'PASSED' : MYVAR1 = 'FAILED'; MYVAR1" ); - - // get around potential parse time error by putting expression in an eval statement - - testcases[tc].actual = eval ( testcases[tc].actual ); - - 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 ); -} diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.13.1.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.13.1.js deleted file mode 100644 index 537ec28..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.13.1.js +++ /dev/null @@ -1,70 +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: 11.13.1.js - ECMA Section: 11.13.1 Simple assignment - Description: - - 11.13.1 Simple Assignment ( = ) - - The production AssignmentExpression : - LeftHandSideExpression = AssignmentExpression is evaluated as follows: - - 1. Evaluate LeftHandSideExpression. - 2. Evaluate AssignmentExpression. - 3. Call GetValue(Result(2)). - 4. Call PutValue(Result(1), Result(3)). - 5. Return Result(3). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.13.1"; - var VERSION = "ECMA_1"; - startTest(); - var testcases = getTestCases(); - - writeHeaderToLog( SECTION + " Simple Assignment ( = )"); - test(); - -function getTestCases() { - var array = new Array(); - var item = 0; - - array[item++] = new TestCase( SECTION, "SOMEVAR = true", true, SOMEVAR = true ); - - - 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/Expressions/11.13.2-1.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.13.2-1.js deleted file mode 100644 index 721fb19..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.13.2-1.js +++ /dev/null @@ -1,122 +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: 11.13.2-1.js - ECMA Section: 11.13.2 Compound Assignment: *= - Description: - - *= /= %= += -= <<= >>= >>>= &= ^= |= - - 11.13.2 Compound assignment ( op= ) - - The production AssignmentExpression : - LeftHandSideExpression @ = AssignmentExpression, where @ represents one of - the operators indicated above, is evaluated as follows: - - 1. Evaluate LeftHandSideExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate AssignmentExpression. - 4. Call GetValue(Result(3)). - 5. Apply operator @ to Result(2) and Result(4). - 6. Call PutValue(Result(1), Result(5)). - 7. Return Result(5). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.13.2-1"; - var VERSION = "ECMA_1"; - startTest(); - var testcases = getTestCases(); - - writeHeaderToLog( SECTION + " Compound Assignment: *="); - test(); - -function getTestCases() { - var array = new Array(); - var item = 0; - - // NaN cases - - array[item++] = new TestCase( SECTION, "VAR1 = NaN; VAR2=1; VAR1 *= VAR2", Number.NaN, eval("VAR1 = Number.NaN; VAR2=1; VAR1 *= VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = NaN; VAR2=1; VAR1 *= VAR2; VAR1", Number.NaN, eval("VAR1 = Number.NaN; VAR2=1; VAR1 *= VAR2; VAR1") ); - - // number cases - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2=1; VAR1 *= VAR2", 0, eval("VAR1 = 0; VAR2=1; VAR1 *= VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2=1; VAR1 *= VAR2;VAR1", 0, eval("VAR1 = 0; VAR2=1; VAR1 *= VAR2;VAR1") ); - - array[item++] = new TestCase( SECTION, "VAR1 = 0xFF; VAR2 = 0xA, VAR1 *= VAR2", 2550, eval("VAR1 = 0XFF; VAR2 = 0XA, VAR1 *= VAR2") ); - - // special multiplication cases - - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= Infinity; VAR1 *= VAR2", Number.NaN, eval("VAR1 = 0; VAR2 = Number.POSITIVE_INFINITY; VAR1 *= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= Infinity; VAR1 *= VAR2", Number.NaN, eval("VAR1 = -0; VAR2 = Number.POSITIVE_INFINITY; VAR1 *= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= -Infinity; VAR1 *= VAR2", Number.NaN, eval("VAR1 = -0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 *= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= -Infinity; VAR1 *= VAR2", Number.NaN, eval("VAR1 = 0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 *= VAR2; VAR1") ); - - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= Infinity; VAR2 *= VAR1", Number.NaN, eval("VAR1 = 0; VAR2 = Number.POSITIVE_INFINITY; VAR2 *= VAR1; VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= Infinity; VAR2 *= VAR1", Number.NaN, eval("VAR1 = -0; VAR2 = Number.POSITIVE_INFINITY; VAR2 *= VAR1; VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= -Infinity; VAR2 *= VAR1", Number.NaN, eval("VAR1 = -0; VAR2 = Number.NEGATIVE_INFINITY; VAR2 *= VAR1; VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= -Infinity; VAR2 *= VAR1", Number.NaN, eval("VAR1 = 0; VAR2 = Number.NEGATIVE_INFINITY; VAR2 *= VAR1; VAR2") ); - - array[item++] = new TestCase( SECTION, "VAR1 = Infinity; VAR2= Infinity; VAR1 *= VAR2", Number.POSITIVE_INFINITY, eval("VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 *= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = Infinity; VAR2= -Infinity; VAR1 *= VAR2", Number.NEGATIVE_INFINITY, eval("VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 *= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 =-Infinity; VAR2= Infinity; VAR1 *= VAR2", Number.NEGATIVE_INFINITY, eval("VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 *= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 =-Infinity; VAR2=-Infinity; VAR1 *= VAR2", Number.POSITIVE_INFINITY, eval("VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 *= VAR2; VAR1") ); - - // string cases - array[item++] = new TestCase( SECTION, "VAR1 = 10; VAR2 = '255', VAR1 *= VAR2", 2550, eval("VAR1 = 10; VAR2 = '255', VAR1 *= VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = '255'; VAR2 = 10, VAR1 *= VAR2", 2550, eval("VAR1 = '255'; VAR2 = 10, VAR1 *= VAR2") ); - - array[item++] = new TestCase( SECTION, "VAR1 = 10; VAR2 = '0XFF', VAR1 *= VAR2", 2550, eval("VAR1 = 10; VAR2 = '0XFF', VAR1 *= VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 *= VAR2", 2550, eval("VAR1 = '0XFF'; VAR2 = 0XA, VAR1 *= VAR2") ); - - array[item++] = new TestCase( SECTION, "VAR1 = '10'; VAR2 = '255', VAR1 *= VAR2", 2550, eval("VAR1 = '10'; VAR2 = '255', VAR1 *= VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = '10'; VAR2 = '0XFF', VAR1 *= VAR2", 2550, eval("VAR1 = '10'; VAR2 = '0XFF', VAR1 *= VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 *= VAR2", 2550, eval("VAR1 = '0XFF'; VAR2 = 0XA, VAR1 *= VAR2") ); - - // boolean cases - array[item++] = new TestCase( SECTION, "VAR1 = true; VAR2 = false; VAR1 *= VAR2", 0, eval("VAR1 = true; VAR2 = false; VAR1 *= VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = true; VAR2 = true; VAR1 *= VAR2", 1, eval("VAR1 = true; VAR2 = true; VAR1 *= VAR2") ); - - // object cases - array[item++] = new TestCase( SECTION, "VAR1 = new Boolean(true); VAR2 = 10; VAR1 *= VAR2;VAR1", 10, eval("VAR1 = new Boolean(true); VAR2 = 10; VAR1 *= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = new Number(11); VAR2 = 10; VAR1 *= VAR2; VAR1", 110, eval("VAR1 = new Number(11); VAR2 = 10; VAR1 *= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = new Number(11); VAR2 = new Number(10); VAR1 *= VAR2", 110, eval("VAR1 = new Number(11); VAR2 = new Number(10); VAR1 *= VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = new String('15'); VAR2 = new String('0xF'); VAR1 *= VAR2", 225, eval("VAR1 = String('15'); VAR2 = new String('0xF'); VAR1 *= VAR2") ); - - - 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/Expressions/11.13.2-2.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.13.2-2.js deleted file mode 100644 index 5838acf..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.13.2-2.js +++ /dev/null @@ -1,136 +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: 11.13.2-2js - ECMA Section: 11.13.2 Compound Assignment: /= - Description: - - *= /= %= += -= <<= >>= >>>= &= ^= |= - - 11.13.2 Compound assignment ( op= ) - - The production AssignmentExpression : - LeftHandSideExpression @ = AssignmentExpression, where @ represents one of - the operators indicated above, is evaluated as follows: - - 1. Evaluate LeftHandSideExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate AssignmentExpression. - 4. Call GetValue(Result(3)). - 5. Apply operator @ to Result(2) and Result(4). - 6. Call PutValue(Result(1), Result(5)). - 7. Return Result(5). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.13.2-2"; - var VERSION = "ECMA_1"; - startTest(); - var testcases = getTestCases(); - - writeHeaderToLog( SECTION + " Compound Assignment: /="); - test(); - -function getTestCases() { - var array = new Array(); - var item = 0; - - // NaN cases - - array[item++] = new TestCase( SECTION, "VAR1 = NaN; VAR2=1; VAR1 /= VAR2", Number.NaN, eval("VAR1 = Number.NaN; VAR2=1; VAR1 /= VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = NaN; VAR2=1; VAR1 /= VAR2; VAR1", Number.NaN, eval("VAR1 = Number.NaN; VAR2=1; VAR1 /= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = NaN; VAR2=0; VAR1 /= VAR2", Number.NaN, eval("VAR1 = Number.NaN; VAR2=0; VAR1 /= VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = NaN; VAR2=0; VAR1 /= VAR2; VAR1", Number.NaN, eval("VAR1 = Number.NaN; VAR2=0; VAR1 /= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2=NaN; VAR1 /= VAR2", Number.NaN, eval("VAR1 = 0; VAR2=Number.NaN; VAR1 /= VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2=NaN; VAR1 /= VAR2; VAR1", Number.NaN, eval("VAR1 = 0; VAR2=Number.NaN; VAR1 /= VAR2; VAR1") ); - - // number cases - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2=1; VAR1 /= VAR2", 0, eval("VAR1 = 0; VAR2=1; VAR1 /= VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2=1; VAR1 /= VAR2;VAR1", 0, eval("VAR1 = 0; VAR2=1; VAR1 /= VAR2;VAR1") ); - - array[item++] = new TestCase( SECTION, "VAR1 = 0xFF; VAR2 = 0xA, VAR1 /= VAR2", 25.5, eval("VAR1 = 0XFF; VAR2 = 0XA, VAR1 /= VAR2") ); - - // special division cases - - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= Infinity; VAR1 /= VAR2", 0, eval("VAR1 = 0; VAR2 = Number.POSITIVE_INFINITY; VAR1 /= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= Infinity; VAR1 /= VAR2", 0, eval("VAR1 = -0; VAR2 = Number.POSITIVE_INFINITY; VAR1 /= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= -Infinity; VAR1 /= VAR2", 0, eval("VAR1 = -0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 /= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= -Infinity; VAR1 /= VAR2", 0, eval("VAR1 = 0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 /= VAR2; VAR1") ); - - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= Infinity; VAR2 /= VAR1", Number.POSITIVE_INFINITY, eval("VAR1 = 0; VAR2 = Number.POSITIVE_INFINITY; VAR2 /= VAR1; VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= Infinity; VAR2 /= VAR1", Number.NEGATIVE_INFINITY, eval("VAR1 = -0; VAR2 = Number.POSITIVE_INFINITY; VAR2 /= VAR1; VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= -Infinity; VAR2 /= VAR1", Number.POSITIVE_INFINITY, eval("VAR1 = -0; VAR2 = Number.NEGATIVE_INFINITY; VAR2 /= VAR1; VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= -Infinity; VAR2 /= VAR1", Number.NEGATIVE_INFINITY, eval("VAR1 = 0; VAR2 = Number.NEGATIVE_INFINITY; VAR2 /= VAR1; VAR2") ); - - array[item++] = new TestCase( SECTION, "VAR1 = Infinity; VAR2= Infinity; VAR1 /= VAR2", Number.NaN, eval("VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 /= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = Infinity; VAR2= -Infinity; VAR1 /= VAR2", Number.NaN, eval("VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 /= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 =-Infinity; VAR2= Infinity; VAR1 /= VAR2", Number.NaN, eval("VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 /= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 =-Infinity; VAR2=-Infinity; VAR1 /= VAR2", Number.NaN, eval("VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 /= VAR2; VAR1") ); - - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= 0; VAR1 /= VAR2", Number.NaN, eval("VAR1 = 0; VAR2 = 0; VAR1 /= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= -0; VAR1 /= VAR2", Number.NaN, eval("VAR1 = 0; VAR2 = -0; VAR1 /= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= 0; VAR1 /= VAR2", Number.NaN, eval("VAR1 = -0; VAR2 = 0; VAR1 /= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= -0; VAR1 /= VAR2", Number.NaN, eval("VAR1 = -0; VAR2 = -0; VAR1 /= VAR2; VAR1") ); - - array[item++] = new TestCase( SECTION, "VAR1 = 1; VAR2= 0; VAR1 /= VAR2", Number.POSITIVE_INFINITY, eval("VAR1 = 1; VAR2 = 0; VAR1 /= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = 1; VAR2= -0; VAR1 /= VAR2", Number.NEGATIVE_INFINITY, eval("VAR1 = 1; VAR2 = -0; VAR1 /= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = -1; VAR2= 0; VAR1 /= VAR2", Number.NEGATIVE_INFINITY, eval("VAR1 = -1; VAR2 = 0; VAR1 /= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = -1; VAR2= -0; VAR1 /= VAR2", Number.POSITIVE_INFINITY, eval("VAR1 = -1; VAR2 = -0; VAR1 /= VAR2; VAR1") ); - - // string cases - array[item++] = new TestCase( SECTION, "VAR1 = 1000; VAR2 = '10', VAR1 /= VAR2; VAR1", 100, eval("VAR1 = 1000; VAR2 = '10', VAR1 /= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = '1000'; VAR2 = 10, VAR1 /= VAR2; VAR1", 100, eval("VAR1 = '1000'; VAR2 = 10, VAR1 /= VAR2; VAR1") ); -/* - array[item++] = new TestCase( SECTION, "VAR1 = 10; VAR2 = '0XFF', VAR1 /= VAR2", 2550, eval("VAR1 = 10; VAR2 = '0XFF', VAR1 /= VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 /= VAR2", 2550, eval("VAR1 = '0XFF'; VAR2 = 0XA, VAR1 /= VAR2") ); - - array[item++] = new TestCase( SECTION, "VAR1 = '10'; VAR2 = '255', VAR1 /= VAR2", 2550, eval("VAR1 = '10'; VAR2 = '255', VAR1 /= VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = '10'; VAR2 = '0XFF', VAR1 /= VAR2", 2550, eval("VAR1 = '10'; VAR2 = '0XFF', VAR1 /= VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 /= VAR2", 2550, eval("VAR1 = '0XFF'; VAR2 = 0XA, VAR1 /= VAR2") ); - - // boolean cases - array[item++] = new TestCase( SECTION, "VAR1 = true; VAR2 = false; VAR1 /= VAR2", 0, eval("VAR1 = true; VAR2 = false; VAR1 /= VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = true; VAR2 = true; VAR1 /= VAR2", 1, eval("VAR1 = true; VAR2 = true; VAR1 /= VAR2") ); - - // object cases - array[item++] = new TestCase( SECTION, "VAR1 = new Boolean(true); VAR2 = 10; VAR1 /= VAR2;VAR1", 10, eval("VAR1 = new Boolean(true); VAR2 = 10; VAR1 /= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = new Number(11); VAR2 = 10; VAR1 /= VAR2; VAR1", 110, eval("VAR1 = new Number(11); VAR2 = 10; VAR1 /= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = new Number(11); VAR2 = new Number(10); VAR1 /= VAR2", 110, eval("VAR1 = new Number(11); VAR2 = new Number(10); VAR1 /= VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = new String('15'); VAR2 = new String('0xF'); VAR1 /= VAR2", 255, eval("VAR1 = String('15'); VAR2 = new String('0xF'); VAR1 /= VAR2") ); - -*/ - 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/Expressions/11.13.2-3.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.13.2-3.js deleted file mode 100644 index cf151db..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.13.2-3.js +++ /dev/null @@ -1,149 +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: 11.13.2-4.js - ECMA Section: 11.13.2 Compound Assignment: %= - Description: - - *= /= %= += -= <<= >>= >>>= &= ^= |= - - 11.13.2 Compound assignment ( op= ) - - The production AssignmentExpression : - LeftHandSideExpression @ = AssignmentExpression, where @ represents one of - the operators indicated above, is evaluated as follows: - - 1. Evaluate LeftHandSideExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate AssignmentExpression. - 4. Call GetValue(Result(3)). - 5. Apply operator @ to Result(2) and Result(4). - 6. Call PutValue(Result(1), Result(5)). - 7. Return Result(5). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.13.2-3"; - var VERSION = "ECMA_1"; - startTest(); - var testcases = getTestCases(); - - writeHeaderToLog( SECTION + " Compound Assignment: +="); - test(); - -function getTestCases() { - var array = new Array(); - var item = 0; - - // If either operand is NaN, result is NaN - - array[item++] = new TestCase( SECTION, "VAR1 = NaN; VAR2=1; VAR1 %= VAR2", Number.NaN, eval("VAR1 = Number.NaN; VAR2=1; VAR1 %= VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = NaN; VAR2=1; VAR1 %= VAR2; VAR1", Number.NaN, eval("VAR1 = Number.NaN; VAR2=1; VAR1 %= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = NaN; VAR2=0; VAR1 %= VAR2", Number.NaN, eval("VAR1 = Number.NaN; VAR2=0; VAR1 %= VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = NaN; VAR2=0; VAR1 %= VAR2; VAR1", Number.NaN, eval("VAR1 = Number.NaN; VAR2=0; VAR1 %= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2=NaN; VAR1 %= VAR2", Number.NaN, eval("VAR1 = 0; VAR2=Number.NaN; VAR1 %= VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2=NaN; VAR1 %= VAR2; VAR1", Number.NaN, eval("VAR1 = 0; VAR2=Number.NaN; VAR1 %= VAR2; VAR1") ); - - // if the dividend is infinity or the divisor is zero or both, the result is NaN - - array[item++] = new TestCase( SECTION, "VAR1 = Infinity; VAR2= Infinity; VAR1 %= VAR2; VAR1", Number.NaN, eval("VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 %= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = Infinity; VAR2= -Infinity; VAR1 %= VAR2; VAR1", Number.NaN, eval("VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 %= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 =-Infinity; VAR2= Infinity; VAR1 %= VAR2; VAR1", Number.NaN, eval("VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 %= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 =-Infinity; VAR2=-Infinity; VAR1 %= VAR2; VAR1", Number.NaN, eval("VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 %= VAR2; VAR1") ); - - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= Infinity; VAR2 %= VAR1", Number.NaN, eval("VAR1 = 0; VAR2 = Number.POSITIVE_INFINITY; VAR2 %= VAR1; VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= Infinity; VAR2 %= VAR1", Number.NaN, eval("VAR1 = -0; VAR2 = Number.POSITIVE_INFINITY; VAR2 %= VAR1; VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= -Infinity; VAR2 %= VAR1", Number.NaN, eval("VAR1 = -0; VAR2 = Number.NEGATIVE_INFINITY; VAR2 %= VAR1; VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= -Infinity; VAR2 %= VAR1", Number.NaN, eval("VAR1 = 0; VAR2 = Number.NEGATIVE_INFINITY; VAR2 %= VAR1; VAR2") ); - - array[item++] = new TestCase( SECTION, "VAR1 = 1; VAR2= Infinity; VAR2 %= VAR1", Number.NaN, eval("VAR1 = 1; VAR2 = Number.POSITIVE_INFINITY; VAR2 %= VAR1; VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = -1; VAR2= Infinity; VAR2 %= VAR1", Number.NaN, eval("VAR1 = -1; VAR2 = Number.POSITIVE_INFINITY; VAR2 %= VAR1; VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = -1; VAR2= -Infinity; VAR2 %= VAR1", Number.NaN, eval("VAR1 = -1; VAR2 = Number.NEGATIVE_INFINITY; VAR2 %= VAR1; VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = 1; VAR2= -Infinity; VAR2 %= VAR1", Number.NaN, eval("VAR1 = 1; VAR2 = Number.NEGATIVE_INFINITY; VAR2 %= VAR1; VAR2") ); - - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= 0; VAR1 %= VAR2", Number.NaN, eval("VAR1 = 0; VAR2 = 0; VAR1 %= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= -0; VAR1 %= VAR2", Number.NaN, eval("VAR1 = 0; VAR2 = -0; VAR1 %= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= 0; VAR1 %= VAR2", Number.NaN, eval("VAR1 = -0; VAR2 = 0; VAR1 %= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= -0; VAR1 %= VAR2", Number.NaN, eval("VAR1 = -0; VAR2 = -0; VAR1 %= VAR2; VAR1") ); - - array[item++] = new TestCase( SECTION, "VAR1 = 1; VAR2= 0; VAR1 %= VAR2", Number.NaN, eval("VAR1 = 1; VAR2 = 0; VAR1 %= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = 1; VAR2= -0; VAR1 %= VAR2", Number.NaN, eval("VAR1 = 1; VAR2 = -0; VAR1 %= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = -1; VAR2= 0; VAR1 %= VAR2", Number.NaN, eval("VAR1 = -1; VAR2 = 0; VAR1 %= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = -1; VAR2= -0; VAR1 %= VAR2", Number.NaN, eval("VAR1 = -1; VAR2 = -0; VAR1 %= VAR2; VAR1") ); - - // if the dividend is finite and the divisor is an infinity, the result equals the dividend. - - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= Infinity; VAR1 %= VAR2;VAR1", 0, eval("VAR1 = 0; VAR2 = Number.POSITIVE_INFINITY; VAR1 %= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= Infinity; VAR1 %= VAR2;VAR1", -0, eval("VAR1 = -0; VAR2 = Number.POSITIVE_INFINITY; VAR1 %= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= -Infinity; VAR1 %= VAR2;VAR1", -0, eval("VAR1 = -0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 %= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= -Infinity; VAR1 %= VAR2;VAR1", 0, eval("VAR1 = 0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 %= VAR2; VAR1") ); - - array[item++] = new TestCase( SECTION, "VAR1 = 1; VAR2= Infinity; VAR1 %= VAR2;VAR1", 1, eval("VAR1 = 1; VAR2 = Number.POSITIVE_INFINITY; VAR1 %= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = -1; VAR2= Infinity; VAR1 %= VAR2;VAR1", -1, eval("VAR1 = -1; VAR2 = Number.POSITIVE_INFINITY; VAR1 %= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = -1; VAR2= -Infinity; VAR1 %= VAR2;VAR1", -1, eval("VAR1 = -1; VAR2 = Number.NEGATIVE_INFINITY; VAR1 %= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = 1; VAR2= -Infinity; VAR1 %= VAR2;VAR1", 1, eval("VAR1 = 1; VAR2 = Number.NEGATIVE_INFINITY; VAR1 %= VAR2; VAR1") ); - - // if the dividend is a zero and the divisor is finite, the result is the same as the dividend - - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= 1; VAR1 %= VAR2; VAR1", 0, eval("VAR1 = 0; VAR2 = 1; VAR1 %= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= 1; VAR1 %= VAR2; VAR1", -0, eval("VAR1 = -0; VAR2 = 1; VAR1 %= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= -1; VAR1 %= VAR2; VAR1", -0, eval("VAR1 = -0; VAR2 = -1; VAR1 %= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= -1; VAR1 %= VAR2; VAR1", 0, eval("VAR1 = 0; VAR2 = -1; VAR1 %= VAR2; VAR1") ); - - // string cases - array[item++] = new TestCase( SECTION, "VAR1 = 1000; VAR2 = '10', VAR1 %= VAR2; VAR1", 0, eval("VAR1 = 1000; VAR2 = '10', VAR1 %= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = '1000'; VAR2 = 10, VAR1 %= VAR2; VAR1", 0, eval("VAR1 = '1000'; VAR2 = 10, VAR1 %= VAR2; VAR1") ); -/* - array[item++] = new TestCase( SECTION, "VAR1 = 10; VAR2 = '0XFF', VAR1 %= VAR2", 2550, eval("VAR1 = 10; VAR2 = '0XFF', VAR1 %= VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 %= VAR2", 2550, eval("VAR1 = '0XFF'; VAR2 = 0XA, VAR1 %= VAR2") ); - - array[item++] = new TestCase( SECTION, "VAR1 = '10'; VAR2 = '255', VAR1 %= VAR2", 2550, eval("VAR1 = '10'; VAR2 = '255', VAR1 %= VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = '10'; VAR2 = '0XFF', VAR1 %= VAR2", 2550, eval("VAR1 = '10'; VAR2 = '0XFF', VAR1 %= VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 %= VAR2", 2550, eval("VAR1 = '0XFF'; VAR2 = 0XA, VAR1 %= VAR2") ); - - // boolean cases - array[item++] = new TestCase( SECTION, "VAR1 = true; VAR2 = false; VAR1 %= VAR2", 0, eval("VAR1 = true; VAR2 = false; VAR1 %= VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = true; VAR2 = true; VAR1 %= VAR2", 1, eval("VAR1 = true; VAR2 = true; VAR1 %= VAR2") ); - - // object cases - array[item++] = new TestCase( SECTION, "VAR1 = new Boolean(true); VAR2 = 10; VAR1 %= VAR2;VAR1", 10, eval("VAR1 = new Boolean(true); VAR2 = 10; VAR1 %= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = new Number(11); VAR2 = 10; VAR1 %= VAR2; VAR1", 110, eval("VAR1 = new Number(11); VAR2 = 10; VAR1 %= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = new Number(11); VAR2 = new Number(10); VAR1 %= VAR2", 110, eval("VAR1 = new Number(11); VAR2 = new Number(10); VAR1 %= VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = new String('15'); VAR2 = new String('0xF'); VAR1 %= VAR2", 255, eval("VAR1 = String('15'); VAR2 = new String('0xF'); VAR1 %= VAR2") ); - -*/ - 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/Expressions/11.13.2-4.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.13.2-4.js deleted file mode 100644 index edf79a7..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.13.2-4.js +++ /dev/null @@ -1,137 +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: 11.13.2-4.js - ECMA Section: 11.13.2 Compound Assignment:+= - Description: - - *= /= %= += -= <<= >>= >>>= &= ^= |= - - 11.13.2 Compound assignment ( op= ) - - The production AssignmentExpression : - LeftHandSideExpression @ = AssignmentExpression, where @ represents one of - the operators indicated above, is evaluated as follows: - - 1. Evaluate LeftHandSideExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate AssignmentExpression. - 4. Call GetValue(Result(3)). - 5. Apply operator @ to Result(2) and Result(4). - 6. Call PutValue(Result(1), Result(5)). - 7. Return Result(5). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.13.2-4"; - var VERSION = "ECMA_1"; - startTest(); - var testcases = getTestCases(); - - writeHeaderToLog( SECTION + " Compound Assignment: +="); - test(); - -function getTestCases() { - var array = new Array(); - var item = 0; - - // If either operand is NaN, result is NaN - - array[item++] = new TestCase( SECTION, "VAR1 = NaN; VAR2=1; VAR1 += VAR2", Number.NaN, eval("VAR1 = Number.NaN; VAR2=1; VAR1 += VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = NaN; VAR2=1; VAR1 += VAR2; VAR1", Number.NaN, eval("VAR1 = Number.NaN; VAR2=1; VAR1 += VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = NaN; VAR2=0; VAR1 += VAR2", Number.NaN, eval("VAR1 = Number.NaN; VAR2=0; VAR1 += VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = NaN; VAR2=0; VAR1 += VAR2; VAR1", Number.NaN, eval("VAR1 = Number.NaN; VAR2=0; VAR1 += VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2=NaN; VAR1 += VAR2", Number.NaN, eval("VAR1 = 0; VAR2=Number.NaN; VAR1 += VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2=NaN; VAR1 += VAR2; VAR1", Number.NaN, eval("VAR1 = 0; VAR2=Number.NaN; VAR1 += VAR2; VAR1") ); - - // the sum of two Infinities the same sign is the infinity of that sign - // the sum of two Infinities of opposite sign is NaN - - array[item++] = new TestCase( SECTION, "VAR1 = Infinity; VAR2= Infinity; VAR1 += VAR2; VAR1", Number.POSITIVE_INFINITY, eval("VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 += VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = Infinity; VAR2= -Infinity; VAR1 += VAR2; VAR1", Number.NaN, eval("VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 += VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 =-Infinity; VAR2= Infinity; VAR1 += VAR2; VAR1", Number.NaN, eval("VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 += VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 =-Infinity; VAR2=-Infinity; VAR1 += VAR2; VAR1", Number.NEGATIVE_INFINITY, eval("VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 += VAR2; VAR1") ); - - // the sum of an infinity and a finite value is equal to the infinite operand - - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= Infinity; VAR1 += VAR2;VAR1", Number.POSITIVE_INFINITY, eval("VAR1 = 0; VAR2 = Number.POSITIVE_INFINITY; VAR1 += VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= Infinity; VAR1 += VAR2;VAR1", Number.POSITIVE_INFINITY, eval("VAR1 = -0; VAR2 = Number.POSITIVE_INFINITY; VAR1 += VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= -Infinity; VAR1 += VAR2;VAR1", Number.NEGATIVE_INFINITY, eval("VAR1 = -0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 += VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= -Infinity; VAR1 += VAR2;VAR1", Number.NEGATIVE_INFINITY, eval("VAR1 = 0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 += VAR2; VAR1") ); - - // the sum of two negative zeros is -0. the sum of two positive zeros, or of two zeros of opposite sign, is +0 - - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= 0; VAR1 += VAR2", 0, eval("VAR1 = 0; VAR2 = 0; VAR1 += VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= -0; VAR1 += VAR2", 0, eval("VAR1 = 0; VAR2 = -0; VAR1 += VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= 0; VAR1 += VAR2", 0, eval("VAR1 = -0; VAR2 = 0; VAR1 += VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= -0; VAR1 += VAR2", -0, eval("VAR1 = -0; VAR2 = -0; VAR1 += VAR2; VAR1") ); - - // the sum of a zero and a nonzero finite value is eqal to the nonzero operand - - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= 1; VAR2 += VAR1; VAR2", 1, eval("VAR1 = 0; VAR2 = 1; VAR2 += VAR1; VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= 1; VAR2 += VAR1; VAR2", 1, eval("VAR1 = -0; VAR2 = 1; VAR2 += VAR1; VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= -1; VAR2 += VAR1; VAR2", -1, eval("VAR1 = -0; VAR2 = -1; VAR2 += VAR1; VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= -1; VAR2 += VAR1; VAR2", -1, eval("VAR1 = 0; VAR2 = -1; VAR2 += VAR1; VAR2") ); - - // the sum of a zero and a nozero finite value is equal to the nonzero operand. - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2=1; VAR1 += VAR2", 1, eval("VAR1 = 0; VAR2=1; VAR1 += VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2=1; VAR1 += VAR2;VAR1", 1, eval("VAR1 = 0; VAR2=1; VAR1 += VAR2;VAR1") ); - - // the sum of two nonzero finite values of the same magnitude and opposite sign is +0 - array[item++] = new TestCase( SECTION, "VAR1 = Number.MAX_VALUE; VAR2= -Number.MAX_VALUE; VAR1 += VAR2; VAR1", 0, eval("VAR1 = Number.MAX_VALUE; VAR2= -Number.MAX_VALUE; VAR1 += VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = Number.MIN_VALUE; VAR2= -Number.MIN_VALUE; VAR1 += VAR2; VAR1", 0, eval("VAR1 = Number.MIN_VALUE; VAR2= -Number.MIN_VALUE; VAR1 += VAR2; VAR1") ); - -/* - array[item++] = new TestCase( SECTION, "VAR1 = 10; VAR2 = '0XFF', VAR1 += VAR2", 2550, eval("VAR1 = 10; VAR2 = '0XFF', VAR1 += VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 += VAR2", 2550, eval("VAR1 = '0XFF'; VAR2 = 0XA, VAR1 += VAR2") ); - - array[item++] = new TestCase( SECTION, "VAR1 = '10'; VAR2 = '255', VAR1 += VAR2", 2550, eval("VAR1 = '10'; VAR2 = '255', VAR1 += VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = '10'; VAR2 = '0XFF', VAR1 += VAR2", 2550, eval("VAR1 = '10'; VAR2 = '0XFF', VAR1 += VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 += VAR2", 2550, eval("VAR1 = '0XFF'; VAR2 = 0XA, VAR1 += VAR2") ); - - // boolean cases - array[item++] = new TestCase( SECTION, "VAR1 = true; VAR2 = false; VAR1 += VAR2", 0, eval("VAR1 = true; VAR2 = false; VAR1 += VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = true; VAR2 = true; VAR1 += VAR2", 1, eval("VAR1 = true; VAR2 = true; VAR1 += VAR2") ); - - // object cases - array[item++] = new TestCase( SECTION, "VAR1 = new Boolean(true); VAR2 = 10; VAR1 += VAR2;VAR1", 10, eval("VAR1 = new Boolean(true); VAR2 = 10; VAR1 += VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = new Number(11); VAR2 = 10; VAR1 += VAR2; VAR1", 110, eval("VAR1 = new Number(11); VAR2 = 10; VAR1 += VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = new Number(11); VAR2 = new Number(10); VAR1 += VAR2", 110, eval("VAR1 = new Number(11); VAR2 = new Number(10); VAR1 += VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = new String('15'); VAR2 = new String('0xF'); VAR1 += VAR2", 255, eval("VAR1 = String('15'); VAR2 = new String('0xF'); VAR1 += VAR2") ); - -*/ - 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/Expressions/11.13.2-5.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.13.2-5.js deleted file mode 100644 index 6923bef..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.13.2-5.js +++ /dev/null @@ -1,137 +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: 11.13.2-5.js - ECMA Section: 11.13.2 Compound Assignment: -= - Description: - - *= /= %= -= -= <<= >>= >>>= &= ^= |= - - 11.13.2 Compound assignment ( op= ) - - The production AssignmentExpression : - LeftHandSideExpression @ = AssignmentExpression, where @ represents one of - the operators indicated above, is evaluated as follows: - - 1. Evaluate LeftHandSideExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate AssignmentExpression. - 4. Call GetValue(Result(3)). - 5. Apply operator @ to Result(2) and Result(4). - 6. Call PutValue(Result(1), Result(5)). - 7. Return Result(5). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.13.2-5"; - var VERSION = "ECMA_1"; - startTest(); - var testcases = getTestCases(); - - writeHeaderToLog( SECTION + " Compound Assignment: -="); - test(); - -function getTestCases() { - var array = new Array(); - var item = 0; - - // If either operand is NaN, result is NaN - - array[item++] = new TestCase( SECTION, "VAR1 = NaN; VAR2=1; VAR1 -= VAR2", Number.NaN, eval("VAR1 = Number.NaN; VAR2=1; VAR1 -= VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = NaN; VAR2=1; VAR1 -= VAR2; VAR1", Number.NaN, eval("VAR1 = Number.NaN; VAR2=1; VAR1 -= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = NaN; VAR2=0; VAR1 -= VAR2", Number.NaN, eval("VAR1 = Number.NaN; VAR2=0; VAR1 -= VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = NaN; VAR2=0; VAR1 -= VAR2; VAR1", Number.NaN, eval("VAR1 = Number.NaN; VAR2=0; VAR1 -= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2=NaN; VAR1 -= VAR2", Number.NaN, eval("VAR1 = 0; VAR2=Number.NaN; VAR1 -= VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2=NaN; VAR1 -= VAR2; VAR1", Number.NaN, eval("VAR1 = 0; VAR2=Number.NaN; VAR1 -= VAR2; VAR1") ); - - // the sum of two Infinities the same sign is the infinity of that sign - // the sum of two Infinities of opposite sign is NaN - - array[item++] = new TestCase( SECTION, "VAR1 = Infinity; VAR2= Infinity; VAR1 -= VAR2; VAR1", Number.NaN, eval("VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 -= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = Infinity; VAR2= -Infinity; VAR1 -= VAR2; VAR1", Number.POSITIVE_INFINITY, eval("VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 -= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 =-Infinity; VAR2= Infinity; VAR1 -= VAR2; VAR1", Number.NEGATIVE_INFINITY, eval("VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 -= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 =-Infinity; VAR2=-Infinity; VAR1 -= VAR2; VAR1", Number.NaN, eval("VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 -= VAR2; VAR1") ); - - // the sum of an infinity and a finite value is equal to the infinite operand - - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= Infinity; VAR1 -= VAR2;VAR1", Number.NEGATIVE_INFINITY, eval("VAR1 = 0; VAR2 = Number.POSITIVE_INFINITY; VAR1 -= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= Infinity; VAR1 -= VAR2;VAR1", Number.NEGATIVE_INFINITY, eval("VAR1 = -0; VAR2 = Number.POSITIVE_INFINITY; VAR1 -= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= -Infinity; VAR1 -= VAR2;VAR1", Number.POSITIVE_INFINITY, eval("VAR1 = 0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 -= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= -Infinity; VAR1 -= VAR2;VAR1", Number.POSITIVE_INFINITY, eval("VAR1 = -0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 -= VAR2; VAR1") ); - - // the sum of two negative zeros is -0. the sum of two positive zeros, or of two zeros of opposite sign, is +0 - - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= -0; VAR1 -= VAR2", 0, eval("VAR1 = 0; VAR2 = 0; VAR1 -= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= 0; VAR1 -= VAR2", 0, eval("VAR1 = 0; VAR2 = -0; VAR1 -= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= -0; VAR1 -= VAR2", 0, eval("VAR1 = -0; VAR2 = 0; VAR1 -= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= 0; VAR1 -= VAR2", -0, eval("VAR1 = -0; VAR2 = -0; VAR1 -= VAR2; VAR1") ); - - // the sum of a zero and a nonzero finite value is eqal to the nonzero operand - - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= -1; VAR1 -= VAR2; VAR1", 1, eval("VAR1 = 0; VAR2 = -1; VAR1 -= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= -1; VAR1 -= VAR2; VAR1", 1, eval("VAR1 = -0; VAR2 = -1; VAR1 -= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = -0; VAR2= 1; VAR1 -= VAR2; VAR1", -1, eval("VAR1 = -0; VAR2 = 1; VAR1 -= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2= 1; VAR1 -= VAR2; VAR1", -1, eval("VAR1 = 0; VAR2 = 1; VAR1 -= VAR2; VAR1") ); - - // the sum of a zero and a nozero finite value is equal to the nonzero operand. - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2=-1; VAR1 -= VAR2", 1, eval("VAR1 = 0; VAR2=-1; VAR1 -= VAR2;VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = 0; VAR2=-1; VAR1 -= VAR2;VAR1", 1, eval("VAR1 = 0; VAR2=-1; VAR1 -= VAR2;VAR1") ); - - // the sum of two nonzero finite values of the same magnitude and opposite sign is +0 - array[item++] = new TestCase( SECTION, "VAR1 = Number.MAX_VALUE; VAR2= Number.MAX_VALUE; VAR1 -= VAR2; VAR1", 0, eval("VAR1 = Number.MAX_VALUE; VAR2= Number.MAX_VALUE; VAR1 -= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = Number.MIN_VALUE; VAR2= Number.MIN_VALUE; VAR1 -= VAR2; VAR1", 0, eval("VAR1 = Number.MIN_VALUE; VAR2= Number.MIN_VALUE; VAR1 -= VAR2; VAR1") ); - -/* - array[item++] = new TestCase( SECTION, "VAR1 = 10; VAR2 = '0XFF', VAR1 -= VAR2", 2550, eval("VAR1 = 10; VAR2 = '0XFF', VAR1 -= VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 -= VAR2", 2550, eval("VAR1 = '0XFF'; VAR2 = 0XA, VAR1 -= VAR2") ); - - array[item++] = new TestCase( SECTION, "VAR1 = '10'; VAR2 = '255', VAR1 -= VAR2", 2550, eval("VAR1 = '10'; VAR2 = '255', VAR1 -= VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = '10'; VAR2 = '0XFF', VAR1 -= VAR2", 2550, eval("VAR1 = '10'; VAR2 = '0XFF', VAR1 -= VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 -= VAR2", 2550, eval("VAR1 = '0XFF'; VAR2 = 0XA, VAR1 -= VAR2") ); - - // boolean cases - array[item++] = new TestCase( SECTION, "VAR1 = true; VAR2 = false; VAR1 -= VAR2", 0, eval("VAR1 = true; VAR2 = false; VAR1 -= VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = true; VAR2 = true; VAR1 -= VAR2", 1, eval("VAR1 = true; VAR2 = true; VAR1 -= VAR2") ); - - // object cases - array[item++] = new TestCase( SECTION, "VAR1 = new Boolean(true); VAR2 = 10; VAR1 -= VAR2;VAR1", 10, eval("VAR1 = new Boolean(true); VAR2 = 10; VAR1 -= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = new Number(11); VAR2 = 10; VAR1 -= VAR2; VAR1", 110, eval("VAR1 = new Number(11); VAR2 = 10; VAR1 -= VAR2; VAR1") ); - array[item++] = new TestCase( SECTION, "VAR1 = new Number(11); VAR2 = new Number(10); VAR1 -= VAR2", 110, eval("VAR1 = new Number(11); VAR2 = new Number(10); VAR1 -= VAR2") ); - array[item++] = new TestCase( SECTION, "VAR1 = new String('15'); VAR2 = new String('0xF'); VAR1 -= VAR2", 255, eval("VAR1 = String('15'); VAR2 = new String('0xF'); VAR1 -= VAR2") ); - -*/ - 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/Expressions/11.13.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.13.js deleted file mode 100644 index 73b4d19..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.13.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: 11.12.js - ECMA Section: 11.12 Conditional Operator - Description: - Logi - - calORExpression ? AssignmentExpression : AssignmentExpression - - Semantics - - The production ConditionalExpression : - LogicalORExpression ? AssignmentExpression : AssignmentExpression - is evaluated as follows: - - 1. Evaluate LogicalORExpression. - 2. Call GetValue(Result(1)). - 3. Call ToBoolean(Result(2)). - 4. If Result(3) is false, go to step 8. - 5. Evaluate the first AssignmentExpression. - 6. Call GetValue(Result(5)). - 7. Return Result(6). - 8. Evaluate the second AssignmentExpression. - 9. Call GetValue(Result(8)). - 10. Return Result(9). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.12"; - var VERSION = "ECMA_1"; - startTest(); - var testcases = getTestCases(); - - writeHeaderToLog( SECTION + " Conditional operator( ? : )"); - test(); -function getTestCases() { - var array = new Array(); - var item = 0; - - array[item++] = new TestCase( SECTION, "true ? 'PASSED' : 'FAILED'", "PASSED", (true?"PASSED":"FAILED")); - array[item++] = new TestCase( SECTION, "false ? 'FAILED' : 'PASSED'", "PASSED", (false?"FAILED":"PASSED")); - - array[item++] = new TestCase( SECTION, "1 ? 'PASSED' : 'FAILED'", "PASSED", (true?"PASSED":"FAILED")); - array[item++] = new TestCase( SECTION, "0 ? 'FAILED' : 'PASSED'", "PASSED", (false?"FAILED":"PASSED")); - array[item++] = new TestCase( SECTION, "-1 ? 'PASSED' : 'FAILED'", "PASSED", (true?"PASSED":"FAILED")); - - array[item++] = new TestCase( SECTION, "NaN ? 'FAILED' : 'PASSED'", "PASSED", (Number.NaN?"FAILED":"PASSED")); - - array[item++] = new TestCase( SECTION, "var VAR = true ? , : 'FAILED'", "PASSED", (VAR = true ? "PASSED" : "FAILED") ); - - 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/Expressions/11.14-1.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.14-1.js deleted file mode 100644 index bd3e8f1..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.14-1.js +++ /dev/null @@ -1,73 +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: 11.14-1.js - ECMA Section: 11.14 Comma operator (,) - Description: - Expression : - - AssignmentExpression - Expression , AssignmentExpression - - Semantics - - The production Expression : Expression , AssignmentExpression is evaluated as follows: - - 1. Evaluate Expression. - 2. Call GetValue(Result(1)). - 3. Evaluate AssignmentExpression. - 4. Call GetValue(Result(3)). - 5. Return Result(4). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.14-1"; - var VERSION = "ECMA_1"; - startTest(); - var testcases = getTestCases(); - - writeHeaderToLog( SECTION + " Comma operator (,)"); - 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(); - var item = 0; - - array[item++] = new TestCase( SECTION, "true, false", false, eval("true, false") ); - array[item++] = new TestCase( SECTION, "VAR1=true, VAR2=false", false, eval("VAR1=true, VAR2=false") ); - array[item++] = new TestCase( SECTION, "VAR1=true, VAR2=false;VAR1", true, eval("VAR1=true, VAR2=false; VAR1") ); - return ( array ); -} diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.1-1.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.1-1.js deleted file mode 100644 index 6144c9a..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.1-1.js +++ /dev/null @@ -1,268 +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: 11.2.1-1.js - ECMA Section: 11.2.1 Property Accessors - Description: - - Properties are accessed by name, using either the dot notation: - MemberExpression . Identifier - CallExpression . Identifier - - or the bracket notation: MemberExpression [ Expression ] - CallExpression [ Expression ] - - The dot notation is explained by the following syntactic conversion: - MemberExpression . Identifier - is identical in its behavior to - MemberExpression [ <identifier-string> ] - and similarly - CallExpression . Identifier - is identical in its behavior to - CallExpression [ <identifier-string> ] - where <identifier-string> is a string literal containing the same sequence - of characters as the Identifier. - - The production MemberExpression : MemberExpression [ Expression ] is - evaluated as follows: - - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate Expression. - 4. Call GetValue(Result(3)). - 5. Call ToObject(Result(2)). - 6. Call ToString(Result(4)). - 7. Return a value of type Reference whose base object is Result(5) and - whose property name is Result(6). - - The production CallExpression : CallExpression [ Expression ] is evaluated - in exactly the same manner, except that the contained CallExpression is - evaluated in step 1. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.2.1-1"; - var VERSION = "ECMA_1"; - startTest(); - var TITLE = "Property Accessors"; - writeHeaderToLog( SECTION + " "+TITLE ); - - var testcases = new Array(); - - // go through all Native Function objects, methods, and properties and get their typeof. - - var PROPERTY = new Array(); - var p = 0; - - // properties and functions of the global object - - PROPERTY[p++] = new Property( "this", "NaN", "number" ); - PROPERTY[p++] = new Property( "this", "Infinity", "number" ); - PROPERTY[p++] = new Property( "this", "eval", "function" ); - PROPERTY[p++] = new Property( "this", "parseInt", "function" ); - PROPERTY[p++] = new Property( "this", "parseFloat", "function" ); - PROPERTY[p++] = new Property( "this", "escape", "function" ); - PROPERTY[p++] = new Property( "this", "unescape", "function" ); - PROPERTY[p++] = new Property( "this", "isNaN", "function" ); - PROPERTY[p++] = new Property( "this", "isFinite", "function" ); - PROPERTY[p++] = new Property( "this", "Object", "function" ); - PROPERTY[p++] = new Property( "this", "Number", "function" ); - PROPERTY[p++] = new Property( "this", "Function", "function" ); - PROPERTY[p++] = new Property( "this", "Array", "function" ); - PROPERTY[p++] = new Property( "this", "String", "function" ); - PROPERTY[p++] = new Property( "this", "Boolean", "function" ); - PROPERTY[p++] = new Property( "this", "Date", "function" ); - PROPERTY[p++] = new Property( "this", "Math", "object" ); - - // properties and methods of Object objects - - PROPERTY[p++] = new Property( "Object", "prototype", "object" ); - PROPERTY[p++] = new Property( "Object", "toString", "function" ); - PROPERTY[p++] = new Property( "Object", "valueOf", "function" ); - PROPERTY[p++] = new Property( "Object", "constructor", "function" ); - - // properties of the Function object - - PROPERTY[p++] = new Property( "Function", "prototype", "function" ); - PROPERTY[p++] = new Property( "Function.prototype", "toString", "function" ); - PROPERTY[p++] = new Property( "Function.prototype", "length", "number" ); - PROPERTY[p++] = new Property( "Function.prototype", "valueOf", "function" ); - - Function.prototype.myProperty = "hi"; - - PROPERTY[p++] = new Property( "Function.prototype", "myProperty", "string" ); - - // properties of the Array object - PROPERTY[p++] = new Property( "Array", "prototype", "object" ); - PROPERTY[p++] = new Property( "Array", "length", "number" ); - PROPERTY[p++] = new Property( "Array.prototype", "constructor", "function" ); - PROPERTY[p++] = new Property( "Array.prototype", "toString", "function" ); - PROPERTY[p++] = new Property( "Array.prototype", "join", "function" ); - PROPERTY[p++] = new Property( "Array.prototype", "reverse", "function" ); - PROPERTY[p++] = new Property( "Array.prototype", "sort", "function" ); - - // properties of the String object - PROPERTY[p++] = new Property( "String", "prototype", "object" ); - PROPERTY[p++] = new Property( "String", "fromCharCode", "function" ); - PROPERTY[p++] = new Property( "String.prototype", "toString", "function" ); - PROPERTY[p++] = new Property( "String.prototype", "constructor", "function" ); - PROPERTY[p++] = new Property( "String.prototype", "valueOf", "function" ); - PROPERTY[p++] = new Property( "String.prototype", "charAt", "function" ); - PROPERTY[p++] = new Property( "String.prototype", "charCodeAt", "function" ); - PROPERTY[p++] = new Property( "String.prototype", "indexOf", "function" ); - PROPERTY[p++] = new Property( "String.prototype", "lastIndexOf", "function" ); - PROPERTY[p++] = new Property( "String.prototype", "split", "function" ); - PROPERTY[p++] = new Property( "String.prototype", "substring", "function" ); - PROPERTY[p++] = new Property( "String.prototype", "toLowerCase", "function" ); - PROPERTY[p++] = new Property( "String.prototype", "toUpperCase", "function" ); - PROPERTY[p++] = new Property( "String.prototype", "length", "number" ); - - // properties of the Boolean object - PROPERTY[p++] = new Property( "Boolean", "prototype", "object" ); - PROPERTY[p++] = new Property( "Boolean", "constructor", "function" ); - PROPERTY[p++] = new Property( "Boolean.prototype", "valueOf", "function" ); - PROPERTY[p++] = new Property( "Boolean.prototype", "toString", "function" ); - - // properties of the Number object - - PROPERTY[p++] = new Property( "Number", "MAX_VALUE", "number" ); - PROPERTY[p++] = new Property( "Number", "MIN_VALUE", "number" ); - PROPERTY[p++] = new Property( "Number", "NaN", "number" ); - PROPERTY[p++] = new Property( "Number", "NEGATIVE_INFINITY", "number" ); - PROPERTY[p++] = new Property( "Number", "POSITIVE_INFINITY", "number" ); - PROPERTY[p++] = new Property( "Number.prototype", "toString", "function" ); - PROPERTY[p++] = new Property( "Number.prototype", "constructor", "function" ); - PROPERTY[p++] = new Property( "Number.prototype", "valueOf", "function" ); - - // properties of the Math Object. - PROPERTY[p++] = new Property( "Math", "E", "number" ); - PROPERTY[p++] = new Property( "Math", "LN10", "number" ); - PROPERTY[p++] = new Property( "Math", "LN2", "number" ); - PROPERTY[p++] = new Property( "Math", "LOG2E", "number" ); - PROPERTY[p++] = new Property( "Math", "LOG10E", "number" ); - PROPERTY[p++] = new Property( "Math", "PI", "number" ); - PROPERTY[p++] = new Property( "Math", "SQRT1_2", "number" ); - PROPERTY[p++] = new Property( "Math", "SQRT2", "number" ); - PROPERTY[p++] = new Property( "Math", "abs", "function" ); - PROPERTY[p++] = new Property( "Math", "acos", "function" ); - PROPERTY[p++] = new Property( "Math", "asin", "function" ); - PROPERTY[p++] = new Property( "Math", "atan", "function" ); - PROPERTY[p++] = new Property( "Math", "atan2", "function" ); - PROPERTY[p++] = new Property( "Math", "ceil", "function" ); - PROPERTY[p++] = new Property( "Math", "cos", "function" ); - PROPERTY[p++] = new Property( "Math", "exp", "function" ); - PROPERTY[p++] = new Property( "Math", "floor", "function" ); - PROPERTY[p++] = new Property( "Math", "log", "function" ); - PROPERTY[p++] = new Property( "Math", "max", "function" ); - PROPERTY[p++] = new Property( "Math", "min", "function" ); - PROPERTY[p++] = new Property( "Math", "pow", "function" ); - PROPERTY[p++] = new Property( "Math", "random", "function" ); - PROPERTY[p++] = new Property( "Math", "round", "function" ); - PROPERTY[p++] = new Property( "Math", "sin", "function" ); - PROPERTY[p++] = new Property( "Math", "sqrt", "function" ); - PROPERTY[p++] = new Property( "Math", "tan", "function" ); - - // properties of the Date object - PROPERTY[p++] = new Property( "Date", "parse", "function" ); - PROPERTY[p++] = new Property( "Date", "prototype", "object" ); - PROPERTY[p++] = new Property( "Date", "UTC", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "constructor", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "toString", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "valueOf", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "getTime", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "getYear", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "getFullYear", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "getUTCFullYear", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "getMonth", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "getUTCMonth", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "getDate", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "getUTCDate", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "getDay", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "getUTCDay", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "getHours", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "getUTCHours", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "getMinutes", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "getUTCMinutes", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "getSeconds", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "getUTCSeconds", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "getMilliseconds","function" ); - PROPERTY[p++] = new Property( "Date.prototype", "getUTCMilliseconds", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "setTime", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "setMilliseconds","function" ); - PROPERTY[p++] = new Property( "Date.prototype", "setUTCMilliseconds", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "setSeconds", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "setUTCSeconds", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "setMinutes", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "setUTCMinutes", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "setHours", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "setUTCHours", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "setDate", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "setUTCDate", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "setMonth", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "setUTCMonth", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "setFullYear", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "setUTCFullYear", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "setYear", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "toLocaleString", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "toUTCString", "function" ); - PROPERTY[p++] = new Property( "Date.prototype", "toGMTString", "function" ); - - for ( var i = 0, RESULT; i < PROPERTY.length; i++ ) { - RESULT = eval("typeof " + PROPERTY[i].object + "." + PROPERTY[i].name ); - - testcases[tc++] = new TestCase( SECTION, - "typeof " + PROPERTY[i].object + "." + PROPERTY[i].name, - PROPERTY[i].type, - RESULT ); - - RESULT = eval("typeof " + PROPERTY[i].object + "['" + PROPERTY[i].name +"']"); - - testcases[tc++] = new TestCase( SECTION, - "typeof " + PROPERTY[i].object + "['" + PROPERTY[i].name +"']", - PROPERTY[i].type, - RESULT ); - } - - 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 MyObject( arg0, arg1, arg2, arg3, arg4 ) { - this.name = arg0; -} -function Property( object, name, type ) { - this.object = object; - this.name = name; - this.type = type; -} diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.1-2.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.1-2.js deleted file mode 100644 index fa3056b..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.1-2.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: 11.2.1-2.js - ECMA Section: 11.2.1 Property Accessors - Description: - - Properties are accessed by name, using either the dot notation: - MemberExpression . Identifier - CallExpression . Identifier - - or the bracket notation: MemberExpression [ Expression ] - CallExpression [ Expression ] - - The dot notation is explained by the following syntactic conversion: - MemberExpression . Identifier - is identical in its behavior to - MemberExpression [ <identifier-string> ] - and similarly - CallExpression . Identifier - is identical in its behavior to - CallExpression [ <identifier-string> ] - where <identifier-string> is a string literal containing the same sequence - of characters as the Identifier. - - The production MemberExpression : MemberExpression [ Expression ] is - evaluated as follows: - - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate Expression. - 4. Call GetValue(Result(3)). - 5. Call ToObject(Result(2)). - 6. Call ToString(Result(4)). - 7. Return a value of type Reference whose base object is Result(5) and - whose property name is Result(6). - - The production CallExpression : CallExpression [ Expression ] is evaluated - in exactly the same manner, except that the contained CallExpression is - evaluated in step 1. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.2.1-2"; - var VERSION = "ECMA_1"; - startTest(); - var TITLE = "Property Accessors"; - writeHeaderToLog( SECTION + " "+TITLE ); - - var testcases = new Array(); - - // go through all Native Function objects, methods, and properties and get their typeof. - - var PROPERTY = new Array(); - var p = 0; - - // try to access properties of primitive types - - PROPERTY[p++] = new Property( "\"hi\"", "hi", "hi", NaN ); - PROPERTY[p++] = new Property( NaN, NaN, "NaN", NaN ); -// PROPERTY[p++] = new Property( 3, 3, "3", 3 ); - PROPERTY[p++] = new Property( true, true, "true", 1 ); - PROPERTY[p++] = new Property( false, false, "false", 0 ); - - for ( var i = 0, RESULT; i < PROPERTY.length; i++ ) { - testcases[tc++] = new TestCase( SECTION, - PROPERTY[i].object + ".valueOf()", - PROPERTY[i].value, - eval( PROPERTY[i].object+ ".valueOf()" ) ); - - testcases[tc++] = new TestCase( SECTION, - PROPERTY[i].object + ".toString()", - PROPERTY[i].string, - eval( PROPERTY[i].object+ ".toString()" ) ); - - } - - 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 MyObject( value ) { - this.value = value; - this.stringValue = value +""; - this.numberValue = Number(value); - return this; -} -function Property( object, value, string, number ) { - this.object = object; - this.string = String(value); - this.number = Number(value); - this.value = value; -}
\ No newline at end of file diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.1-3-n.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.1-3-n.js deleted file mode 100644 index f84bb28..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.1-3-n.js +++ /dev/null @@ -1,120 +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: 11.2.1-2.js - ECMA Section: 11.2.1 Property Accessors - Description: - - Properties are accessed by name, using either the dot notation: - MemberExpression . Identifier - CallExpression . Identifier - - or the bracket notation: MemberExpression [ Expression ] - CallExpression [ Expression ] - - The dot notation is explained by the following syntactic conversion: - MemberExpression . Identifier - is identical in its behavior to - MemberExpression [ <identifier-string> ] - and similarly - CallExpression . Identifier - is identical in its behavior to - CallExpression [ <identifier-string> ] - where <identifier-string> is a string literal containing the same sequence - of characters as the Identifier. - - The production MemberExpression : MemberExpression [ Expression ] is - evaluated as follows: - - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate Expression. - 4. Call GetValue(Result(3)). - 5. Call ToObject(Result(2)). - 6. Call ToString(Result(4)). - 7. Return a value of type Reference whose base object is Result(5) and - whose property name is Result(6). - - The production CallExpression : CallExpression [ Expression ] is evaluated - in exactly the same manner, except that the contained CallExpression is - evaluated in step 1. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.2.1-2"; - var VERSION = "ECMA_1"; - startTest(); - var TITLE = "Property Accessors"; - writeHeaderToLog( SECTION + " "+TITLE ); - - var testcases = new Array(); - - // go through all Native Function objects, methods, and properties and get their typeof. - - var PROPERTY = new Array(); - var p = 0; - - // try to access properties of primitive types - - PROPERTY[p++] = new Property( "undefined", void 0, "undefined", NaN ); - - for ( var i = 0, RESULT; i < PROPERTY.length; i++ ) { - testcases[tc++] = new TestCase( SECTION, - PROPERTY[i].object + ".valueOf()", - PROPERTY[i].value, - eval( PROPERTY[i].object+ ".valueOf()" ) ); - - testcases[tc++] = new TestCase( SECTION, - PROPERTY[i].object + ".toString()", - PROPERTY[i].string, - eval( PROPERTY[i].object+ ".toString()" ) ); - - } - - 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 MyObject( value ) { - this.value = value; - this.stringValue = value +""; - this.numberValue = Number(value); - return this; -} -function Property( object, value, string, number ) { - this.object = object; - this.string = String(value); - this.number = Number(value); - this.value = value; -}
\ No newline at end of file diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.1-4-n.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.1-4-n.js deleted file mode 100644 index 0127253..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.1-4-n.js +++ /dev/null @@ -1,120 +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: 11.2.1-4-n.js - ECMA Section: 11.2.1 Property Accessors - Description: - - Properties are accessed by name, using either the dot notation: - MemberExpression . Identifier - CallExpression . Identifier - - or the bracket notation: MemberExpression [ Expression ] - CallExpression [ Expression ] - - The dot notation is explained by the following syntactic conversion: - MemberExpression . Identifier - is identical in its behavior to - MemberExpression [ <identifier-string> ] - and similarly - CallExpression . Identifier - is identical in its behavior to - CallExpression [ <identifier-string> ] - where <identifier-string> is a string literal containing the same sequence - of characters as the Identifier. - - The production MemberExpression : MemberExpression [ Expression ] is - evaluated as follows: - - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate Expression. - 4. Call GetValue(Result(3)). - 5. Call ToObject(Result(2)). - 6. Call ToString(Result(4)). - 7. Return a value of type Reference whose base object is Result(5) and - whose property name is Result(6). - - The production CallExpression : CallExpression [ Expression ] is evaluated - in exactly the same manner, except that the contained CallExpression is - evaluated in step 1. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.2.1-4-n"; - var VERSION = "ECMA_1"; - startTest(); - var TITLE = "Property Accessors"; - writeHeaderToLog( SECTION + " "+TITLE ); - - var testcases = new Array(); - - // go through all Native Function objects, methods, and properties and get their typeof. - - var PROPERTY = new Array(); - var p = 0; - - // try to access properties of primitive types - - PROPERTY[p++] = new Property( "null", null, "null", 0 ); - - for ( var i = 0, RESULT; i < PROPERTY.length; i++ ) { - testcases[tc++] = new TestCase( SECTION, - PROPERTY[i].object + ".valueOf()", - PROPERTY[i].value, - eval( PROPERTY[i].object+ ".valueOf()" ) ); - - testcases[tc++] = new TestCase( SECTION, - PROPERTY[i].object + ".toString()", - PROPERTY[i].string, - eval( PROPERTY[i].object+ ".toString()" ) ); - - } - - 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 MyObject( value ) { - this.value = value; - this.stringValue = value +""; - this.numberValue = Number(value); - return this; -} -function Property( object, value, string, number ) { - this.object = object; - this.string = String(value); - this.number = Number(value); - this.value = value; -}
\ No newline at end of file diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.1-5.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.1-5.js deleted file mode 100644 index 0cb19c9..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.1-5.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: 11.2.1-5.js - ECMA Section: 11.2.1 Property Accessors - Description: - - Properties are accessed by name, using either the dot notation: - MemberExpression . Identifier - CallExpression . Identifier - - or the bracket notation: MemberExpression [ Expression ] - CallExpression [ Expression ] - - The dot notation is explained by the following syntactic conversion: - MemberExpression . Identifier - is identical in its behavior to - MemberExpression [ <identifier-string> ] - and similarly - CallExpression . Identifier - is identical in its behavior to - CallExpression [ <identifier-string> ] - where <identifier-string> is a string literal containing the same sequence - of characters as the Identifier. - - The production MemberExpression : MemberExpression [ Expression ] is - evaluated as follows: - - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate Expression. - 4. Call GetValue(Result(3)). - 5. Call ToObject(Result(2)). - 6. Call ToString(Result(4)). - 7. Return a value of type Reference whose base object is Result(5) and - whose property name is Result(6). - - The production CallExpression : CallExpression [ Expression ] is evaluated - in exactly the same manner, except that the contained CallExpression is - evaluated in step 1. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.2.1-5"; - var VERSION = "ECMA_1"; - startTest(); - var TITLE = "Property Accessors"; - writeHeaderToLog( SECTION + " "+TITLE ); - - var testcases = new Array(); - - // go through all Native Function objects, methods, and properties and get their typeof. - - var PROPERTY = new Array(); - var p = 0; - - // try to access properties of primitive types - - PROPERTY[p++] = new Property( new String("hi"), "hi", "hi", NaN ); - PROPERTY[p++] = new Property( new Number(NaN), NaN, "NaN", NaN ); - PROPERTY[p++] = new Property( new Number(3), 3, "3", 3 ); - PROPERTY[p++] = new Property( new Boolean(true), true, "true", 1 ); - PROPERTY[p++] = new Property( new Boolean(false), false, "false", 0 ); - - for ( var i = 0, RESULT; i < PROPERTY.length; i++ ) { - testcases[tc++] = new TestCase( SECTION, - PROPERTY[i].object + ".valueOf()", - PROPERTY[i].value, - eval( "PROPERTY[i].object.valueOf()" ) ); - - testcases[tc++] = new TestCase( SECTION, - PROPERTY[i].object + ".toString()", - PROPERTY[i].string, - eval( "PROPERTY[i].object.toString()" ) ); - - } - - 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 MyObject( value ) { - this.value = value; - this.stringValue = value +""; - this.numberValue = Number(value); - return this; -} -function Property( object, value, string, number ) { - this.object = object; - this.string = String(value); - this.number = Number(value); - this.value = value; -}
\ No newline at end of file diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.2-1-n.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.2-1-n.js deleted file mode 100644 index db73cad..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.2-1-n.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: 11.2.2-1.js - ECMA Section: 11.2.2. The new operator - Description: - - MemberExpression: - PrimaryExpression - MemberExpression[Expression] - MemberExpression.Identifier - new MemberExpression Arguments - - new NewExpression - - The production NewExpression : new NewExpression is evaluated as follows: - - 1. Evaluate NewExpression. - 2. Call GetValue(Result(1)). - 3. If Type(Result(2)) is not Object, generate a runtime error. - 4. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 5. Call the [[Construct]] method on Result(2), providing no arguments - (that is, an empty list of arguments). - 6. If Type(Result(5)) is not Object, generate a runtime error. - 7. Return Result(5). - - The production MemberExpression : new MemberExpression Arguments is evaluated as follows: - - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate Arguments, producing an internal list of argument values - (section 0). - 4. If Type(Result(2)) is not Object, generate a runtime error. - 5. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 6. Call the [[Construct]] method on Result(2), providing the list - Result(3) as the argument values. - 7. If Type(Result(6)) is not Object, generate a runtime error. - 8 .Return Result(6). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - - var SECTION = "11.2.2-1-n.js"; - var VERSION = "ECMA_1"; - startTest(); - var TITLE = "The new operator"; - - writeHeaderToLog( SECTION + " "+ TITLE); - - var testcases = new Array(); - - - var OBJECT = new Object(); - - testcases[tc++] = new TestCase( SECTION, - "OBJECT = new Object; var o = new OBJECT()", - "error", - o = new OBJECT() ); - test(); - -function TestFunction() { - return arguments; -} -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/Expressions/11.2.2-1.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.2-1.js deleted file mode 100644 index 48c2e6a..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.2-1.js +++ /dev/null @@ -1,99 +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: 11.2.2-1.js - ECMA Section: 11.2.2. The new operator - Description: - - MemberExpression: - PrimaryExpression - MemberExpression[Expression] - MemberExpression.Identifier - new MemberExpression Arguments - - new NewExpression - - The production NewExpression : new NewExpression is evaluated as follows: - - 1. Evaluate NewExpression. - 2. Call GetValue(Result(1)). - 3. If Type(Result(2)) is not Object, generate a runtime error. - 4. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 5. Call the [[Construct]] method on Result(2), providing no arguments - (that is, an empty list of arguments). - 6. If Type(Result(5)) is not Object, generate a runtime error. - 7. Return Result(5). - - The production MemberExpression : new MemberExpression Arguments is evaluated as follows: - - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate Arguments, producing an internal list of argument values - (section 0). - 4. If Type(Result(2)) is not Object, generate a runtime error. - 5. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 6. Call the [[Construct]] method on Result(2), providing the list - Result(3) as the argument values. - 7. If Type(Result(6)) is not Object, generate a runtime error. - 8 .Return Result(6). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - - var SECTION = "11.2.2-1"; - var VERSION = "ECMA_1"; - startTest(); - var TITLE = "The new operator"; - - writeHeaderToLog( SECTION + " "+ TITLE); - - var testcases = new Array(); - - - testcases[tc++] = new TestCase( SECTION, - "(new TestFunction(0,1,2,3,4,5)).length", - 6, - (new TestFunction(0,1,2,3,4,5)).length ); - - - - test(); - -function TestFunction() { - return arguments; -} -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/Expressions/11.2.2-10-n.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.2-10-n.js deleted file mode 100644 index 619554d..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.2-10-n.js +++ /dev/null @@ -1,96 +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: 11.2.2-9-n.js - ECMA Section: 11.2.2. The new operator - Description: - - MemberExpression: - PrimaryExpression - MemberExpression[Expression] - MemberExpression.Identifier - new MemberExpression Arguments - - new NewExpression - - The production NewExpression : new NewExpression is evaluated as follows: - - 1. Evaluate NewExpression. - 2. Call GetValue(Result(1)). - 3. If Type(Result(2)) is not Object, generate a runtime error. - 4. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 5. Call the [[Construct]] method on Result(2), providing no arguments - (that is, an empty list of arguments). - 6. If Type(Result(5)) is not Object, generate a runtime error. - 7. Return Result(5). - - The production MemberExpression : new MemberExpression Arguments is evaluated as follows: - - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate Arguments, producing an internal list of argument values - (section 0). - 4. If Type(Result(2)) is not Object, generate a runtime error. - 5. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 6. Call the [[Construct]] method on Result(2), providing the list - Result(3) as the argument values. - 7. If Type(Result(6)) is not Object, generate a runtime error. - 8 .Return Result(6). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - - var SECTION = "11.2.2-9-n.js"; - var VERSION = "ECMA_1"; - startTest(); - var TITLE = "The new operator"; - - writeHeaderToLog( SECTION + " "+ TITLE); - - var testcases = new Array(); - - - testcases[tc++] = new TestCase( SECTION, - "var m = new Math()", - "error", - m = new Math() ); - test(); - -function TestFunction() { - return arguments; -} -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/Expressions/11.2.2-11.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.2-11.js deleted file mode 100644 index a6f7364..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.2-11.js +++ /dev/null @@ -1,99 +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: 11.2.2-9-n.js - ECMA Section: 11.2.2. The new operator - Description: - - MemberExpression: - PrimaryExpression - MemberExpression[Expression] - MemberExpression.Identifier - new MemberExpression Arguments - - new NewExpression - - The production NewExpression : new NewExpression is evaluated as follows: - - 1. Evaluate NewExpression. - 2. Call GetValue(Result(1)). - 3. If Type(Result(2)) is not Object, generate a runtime error. - 4. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 5. Call the [[Construct]] method on Result(2), providing no arguments - (that is, an empty list of arguments). - 6. If Type(Result(5)) is not Object, generate a runtime error. - 7. Return Result(5). - - The production MemberExpression : new MemberExpression Arguments is evaluated as follows: - - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate Arguments, producing an internal list of argument values - (section 0). - 4. If Type(Result(2)) is not Object, generate a runtime error. - 5. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 6. Call the [[Construct]] method on Result(2), providing the list - Result(3) as the argument values. - 7. If Type(Result(6)) is not Object, generate a runtime error. - 8 Return Result(6). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - - var SECTION = "11.2.2-9-n.js"; - var VERSION = "ECMA_1"; - startTest(); - var TITLE = "The new operator"; - - writeHeaderToLog( SECTION + " "+ TITLE); - - var testcases = new Array(); - - var FUNCTION = new Function(); - - testcases[tc++] = new TestCase( SECTION, - "var FUNCTION = new Function(); f = new FUNCTION(); typeof f", - "object", - eval("var FUNCTION = new Function(); f = new FUNCTION(); typeof f") ); - - testcases[tc++] = new TestCase( SECTION, - "var FUNCTION = new Function('return this'); f = new FUNCTION(); typeof f", - "object", - eval("var FUNCTION = new Function('return this'); f = new FUNCTION(); typeof f") ); - 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 ); -} diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.2-2-n.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.2-2-n.js deleted file mode 100644 index 4e74cd4..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.2-2-n.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: 11.2.2-2.js - ECMA Section: 11.2.2. The new operator - Description: - - MemberExpression: - PrimaryExpression - MemberExpression[Expression] - MemberExpression.Identifier - new MemberExpression Arguments - - new NewExpression - - The production NewExpression : new NewExpression is evaluated as follows: - - 1. Evaluate NewExpression. - 2. Call GetValue(Result(1)). - 3. If Type(Result(2)) is not Object, generate a runtime error. - 4. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 5. Call the [[Construct]] method on Result(2), providing no arguments - (that is, an empty list of arguments). - 6. If Type(Result(5)) is not Object, generate a runtime error. - 7. Return Result(5). - - The production MemberExpression : new MemberExpression Arguments is evaluated as follows: - - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate Arguments, producing an internal list of argument values - (section 0). - 4. If Type(Result(2)) is not Object, generate a runtime error. - 5. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 6. Call the [[Construct]] method on Result(2), providing the list - Result(3) as the argument values. - 7. If Type(Result(6)) is not Object, generate a runtime error. - 8 .Return Result(6). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - - var SECTION = "11.2.2-2-n.js"; - var VERSION = "ECMA_1"; - startTest(); - var TITLE = "The new operator"; - - writeHeaderToLog( SECTION + " "+ TITLE); - - var testcases = new Array(); - - - var UNDEFINED = void 0; - - testcases[tc++] = new TestCase( SECTION, - "UNDEFINED = void 0; var o = new UNDEFINED()", - "error", - o = new UNDEFINED() ); - test(); - -function TestFunction() { - return arguments; -} -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/Expressions/11.2.2-3-n.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.2-3-n.js deleted file mode 100644 index 2c6b509..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.2-3-n.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: 11.2.2-3-n.js - ECMA Section: 11.2.2. The new operator - Description: - - MemberExpression: - PrimaryExpression - MemberExpression[Expression] - MemberExpression.Identifier - new MemberExpression Arguments - - new NewExpression - - The production NewExpression : new NewExpression is evaluated as follows: - - 1. Evaluate NewExpression. - 2. Call GetValue(Result(1)). - 3. If Type(Result(2)) is not Object, generate a runtime error. - 4. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 5. Call the [[Construct]] method on Result(2), providing no arguments - (that is, an empty list of arguments). - 6. If Type(Result(5)) is not Object, generate a runtime error. - 7. Return Result(5). - - The production MemberExpression : new MemberExpression Arguments is evaluated as follows: - - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate Arguments, producing an internal list of argument values - (section 0). - 4. If Type(Result(2)) is not Object, generate a runtime error. - 5. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 6. Call the [[Construct]] method on Result(2), providing the list - Result(3) as the argument values. - 7. If Type(Result(6)) is not Object, generate a runtime error. - 8 .Return Result(6). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - - var SECTION = "11.2.2-3-n.js"; - var VERSION = "ECMA_1"; - startTest(); - var TITLE = "The new operator"; - - writeHeaderToLog( SECTION + " "+ TITLE); - - var testcases = new Array(); - - - var NULL = null; - - testcases[tc++] = new TestCase( SECTION, - "NULL = null; var o = new NULL()", - "error", - o = new NULL() ); - test(); - -function TestFunction() { - return arguments; -} -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/Expressions/11.2.2-4-n.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.2-4-n.js deleted file mode 100644 index a9e5f4a..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.2-4-n.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: 11.2.2-4-n.js - ECMA Section: 11.2.2. The new operator - Description: - - MemberExpression: - PrimaryExpression - MemberExpression[Expression] - MemberExpression.Identifier - new MemberExpression Arguments - - new NewExpression - - The production NewExpression : new NewExpression is evaluated as follows: - - 1. Evaluate NewExpression. - 2. Call GetValue(Result(1)). - 3. If Type(Result(2)) is not Object, generate a runtime error. - 4. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 5. Call the [[Construct]] method on Result(2), providing no arguments - (that is, an empty list of arguments). - 6. If Type(Result(5)) is not Object, generate a runtime error. - 7. Return Result(5). - - The production MemberExpression : new MemberExpression Arguments is evaluated as follows: - - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate Arguments, producing an internal list of argument values - (section 0). - 4. If Type(Result(2)) is not Object, generate a runtime error. - 5. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 6. Call the [[Construct]] method on Result(2), providing the list - Result(3) as the argument values. - 7. If Type(Result(6)) is not Object, generate a runtime error. - 8 .Return Result(6). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - - var SECTION = "11.2.2-4-n.js"; - var VERSION = "ECMA_1"; - startTest(); - var TITLE = "The new operator"; - - writeHeaderToLog( SECTION + " "+ TITLE); - - var testcases = new Array(); - - - var STRING = ""; - - testcases[tc++] = new TestCase( SECTION, - "STRING = '', var s = new STRING()", - "error", - s = new STRING() ); - test(); - -function TestFunction() { - return arguments; -} -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/Expressions/11.2.2-5-n.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.2-5-n.js deleted file mode 100644 index 304f1d3..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.2-5-n.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: 11.2.2-5-n.js - ECMA Section: 11.2.2. The new operator - Description: - - MemberExpression: - PrimaryExpression - MemberExpression[Expression] - MemberExpression.Identifier - new MemberExpression Arguments - - new NewExpression - - The production NewExpression : new NewExpression is evaluated as follows: - - 1. Evaluate NewExpression. - 2. Call GetValue(Result(1)). - 3. If Type(Result(2)) is not Object, generate a runtime error. - 4. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 5. Call the [[Construct]] method on Result(2), providing no arguments - (that is, an empty list of arguments). - 6. If Type(Result(5)) is not Object, generate a runtime error. - 7. Return Result(5). - - The production MemberExpression : new MemberExpression Arguments is evaluated as follows: - - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate Arguments, producing an internal list of argument values - (section 0). - 4. If Type(Result(2)) is not Object, generate a runtime error. - 5. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 6. Call the [[Construct]] method on Result(2), providing the list - Result(3) as the argument values. - 7. If Type(Result(6)) is not Object, generate a runtime error. - 8 .Return Result(6). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - - var SECTION = "11.2.2-5-n.js"; - var VERSION = "ECMA_1"; - startTest(); - var TITLE = "The new operator"; - - writeHeaderToLog( SECTION + " "+ TITLE); - - var testcases = new Array(); - - - var NUMBER = 0; - - testcases[tc++] = new TestCase( SECTION, - "NUMBER=0, var n = new NUMBER()", - "error", - n = new NUMBER() ); - test(); - -function TestFunction() { - return arguments; -} -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/Expressions/11.2.2-6-n.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.2-6-n.js deleted file mode 100644 index fd24e4f..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.2-6-n.js +++ /dev/null @@ -1,81 +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: 11.2.2-6-n.js - ECMA Section: 11.2.2. The new operator - Description: - - MemberExpression: - PrimaryExpression - MemberExpression[Expression] - MemberExpression.Identifier - new MemberExpression Arguments - - new NewExpression - - The production NewExpression : new NewExpression is evaluated as follows: - - 1. Evaluate NewExpression. - 2. Call GetValue(Result(1)). - 3. If Type(Result(2)) is not Object, generate a runtime error. - 4. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 5. Call the [[Construct]] method on Result(2), providing no arguments - (that is, an empty list of arguments). - 6. If Type(Result(5)) is not Object, generate a runtime error. - 7. Return Result(5). - - The production MemberExpression : new MemberExpression Arguments is evaluated as follows: - - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate Arguments, producing an internal list of argument values - (section 0). - 4. If Type(Result(2)) is not Object, generate a runtime error. - 5. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 6. Call the [[Construct]] method on Result(2), providing the list - Result(3) as the argument values. - 7. If Type(Result(6)) is not Object, generate a runtime error. - 8 .Return Result(6). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.2.2-6-n.js"; - var VERSION = "ECMA_1"; - startTest(); - var TITLE = "The new operator"; - - writeHeaderToLog( SECTION + " "+ TITLE); - - var BOOLEAN = true; - - testcases[tc++] = new TestCase( SECTION, - "BOOLEAN = true; var b = new BOOLEAN()", - "error", - b = new BOOLEAN() ); - test(); - -function TestFunction() { - return arguments; -} diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.2-7-n.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.2-7-n.js deleted file mode 100644 index 4a54726..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.2-7-n.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: 11.2.2-6-n.js - ECMA Section: 11.2.2. The new operator - Description: - - MemberExpression: - PrimaryExpression - MemberExpression[Expression] - MemberExpression.Identifier - new MemberExpression Arguments - - new NewExpression - - The production NewExpression : new NewExpression is evaluated as follows: - - 1. Evaluate NewExpression. - 2. Call GetValue(Result(1)). - 3. If Type(Result(2)) is not Object, generate a runtime error. - 4. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 5. Call the [[Construct]] method on Result(2), providing no arguments - (that is, an empty list of arguments). - 6. If Type(Result(5)) is not Object, generate a runtime error. - 7. Return Result(5). - - The production MemberExpression : new MemberExpression Arguments is evaluated as follows: - - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate Arguments, producing an internal list of argument values - (section 0). - 4. If Type(Result(2)) is not Object, generate a runtime error. - 5. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 6. Call the [[Construct]] method on Result(2), providing the list - Result(3) as the argument values. - 7. If Type(Result(6)) is not Object, generate a runtime error. - 8 .Return Result(6). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - - var SECTION = "11.2.2-6-n.js"; - var VERSION = "ECMA_1"; - startTest(); - var TITLE = "The new operator"; - - writeHeaderToLog( SECTION + " "+ TITLE); - - var testcases = new Array(); - - - var STRING = new String("hi"); - - testcases[tc++] = new TestCase( SECTION, - "var STRING = new String('hi'); var s = new STRING()", - "error", - s = new STRING() ); - test(); - -function TestFunction() { - return arguments; -} -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/Expressions/11.2.2-8-n.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.2-8-n.js deleted file mode 100644 index eb58ff5..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.2-8-n.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: 11.2.2-8-n.js - ECMA Section: 11.2.2. The new operator - Description: - - MemberExpression: - PrimaryExpression - MemberExpression[Expression] - MemberExpression.Identifier - new MemberExpression Arguments - - new NewExpression - - The production NewExpression : new NewExpression is evaluated as follows: - - 1. Evaluate NewExpression. - 2. Call GetValue(Result(1)). - 3. If Type(Result(2)) is not Object, generate a runtime error. - 4. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 5. Call the [[Construct]] method on Result(2), providing no arguments - (that is, an empty list of arguments). - 6. If Type(Result(5)) is not Object, generate a runtime error. - 7. Return Result(5). - - The production MemberExpression : new MemberExpression Arguments is evaluated as follows: - - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate Arguments, producing an internal list of argument values - (section 0). - 4. If Type(Result(2)) is not Object, generate a runtime error. - 5. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 6. Call the [[Construct]] method on Result(2), providing the list - Result(3) as the argument values. - 7. If Type(Result(6)) is not Object, generate a runtime error. - 8 .Return Result(6). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - - var SECTION = "11.2.2-8-n.js"; - var VERSION = "ECMA_1"; - startTest(); - var TITLE = "The new operator"; - - writeHeaderToLog( SECTION + " "+ TITLE); - - var testcases = new Array(); - - - var NUMBER = new Number(1); - - testcases[tc++] = new TestCase( SECTION, - "var NUMBER = new Number(1); var n = new NUMBER()", - "error", - n = new NUMBER() ); - test(); - -function TestFunction() { - return arguments; -} -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/Expressions/11.2.2-9-n.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.2-9-n.js deleted file mode 100644 index 56199cf..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.2-9-n.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: 11.2.2-9-n.js - ECMA Section: 11.2.2. The new operator - Description: - - MemberExpression: - PrimaryExpression - MemberExpression[Expression] - MemberExpression.Identifier - new MemberExpression Arguments - - new NewExpression - - The production NewExpression : new NewExpression is evaluated as follows: - - 1. Evaluate NewExpression. - 2. Call GetValue(Result(1)). - 3. If Type(Result(2)) is not Object, generate a runtime error. - 4. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 5. Call the [[Construct]] method on Result(2), providing no arguments - (that is, an empty list of arguments). - 6. If Type(Result(5)) is not Object, generate a runtime error. - 7. Return Result(5). - - The production MemberExpression : new MemberExpression Arguments is evaluated as follows: - - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate Arguments, producing an internal list of argument values - (section 0). - 4. If Type(Result(2)) is not Object, generate a runtime error. - 5. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 6. Call the [[Construct]] method on Result(2), providing the list - Result(3) as the argument values. - 7. If Type(Result(6)) is not Object, generate a runtime error. - 8 .Return Result(6). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - - var SECTION = "11.2.2-9-n.js"; - var VERSION = "ECMA_1"; - startTest(); - var TITLE = "The new operator"; - - writeHeaderToLog( SECTION + " "+ TITLE); - - var testcases = new Array(); - - - var BOOLEAN = new Boolean(); - - testcases[tc++] = new TestCase( SECTION, - "var BOOLEAN = new Boolean(); var b = new BOOLEAN()", - "error", - b = new BOOLEAN() ); - test(); - -function TestFunction() { - return arguments; -} -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/Expressions/11.2.3-1.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.3-1.js deleted file mode 100644 index 7653900..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.3-1.js +++ /dev/null @@ -1,121 +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: 11.2.3-1.js - ECMA Section: 11.2.3. Function Calls - Description: - - The production CallExpression : MemberExpression Arguments is evaluated as - follows: - - 1.Evaluate MemberExpression. - 2.Evaluate Arguments, producing an internal list of argument values - (section 0). - 3.Call GetValue(Result(1)). - 4.If Type(Result(3)) is not Object, generate a runtime error. - 5.If Result(3) does not implement the internal [[Call]] method, generate a - runtime error. - 6.If Type(Result(1)) is Reference, Result(6) is GetBase(Result(1)). Otherwise, - Result(6) is null. - 7.If Result(6) is an activation object, Result(7) is null. Otherwise, Result(7) is - the same as Result(6). - 8.Call the [[Call]] method on Result(3), providing Result(7) as the this value - and providing the list Result(2) as the argument values. - 9.Return Result(8). - - The production CallExpression : CallExpression Arguments is evaluated in - exactly the same manner, except that the contained CallExpression is - evaluated in step 1. - - Note: Result(8) will never be of type Reference if Result(3) is a native - ECMAScript object. Whether calling a host object can return a value of - type Reference is implementation-dependent. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - - var SECTION = "11.2.3-1"; - var VERSION = "ECMA_1"; - startTest(); - var TITLE = "Function Calls"; - - writeHeaderToLog( SECTION + " "+ TITLE); - - var testcases = new Array(); - -/* this.eval() is no longer legal syntax. - // MemberExpression : this - - testcases[tc++] = new TestCase( SECTION, - "this.eval()", - void 0, - this.eval() ); - - testcases[tc++] = new TestCase( SECTION, - "this.eval('NaN')", - NaN, - this.eval("NaN") ); -*/ - // MemberExpression: Identifier - - var OBJECT = true; - - testcases[tc++] = new TestCase( SECTION, - "OBJECT.toString()", - "true", - OBJECT.toString() ); - - // MemberExpression[ Expression] - - testcases[tc++] = new TestCase( SECTION, - "(new Array())['length'].valueOf()", - 0, - (new Array())["length"].valueOf() ); - - // MemberExpression . Identifier - testcases[tc++] = new TestCase( SECTION, - "(new Array()).length.valueOf()", - 0, - (new Array()).length.valueOf() ); - // new MemberExpression Arguments - - testcases[tc++] = new TestCase( SECTION, - "(new Array(20))['length'].valueOf()", - 20, - (new Array(20))["length"].valueOf() ); - - 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 ); -} diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.3-2-n.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.3-2-n.js deleted file mode 100644 index e5ba65c..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.3-2-n.js +++ /dev/null @@ -1,90 +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: 11.2.3-2-n.js - ECMA Section: 11.2.3. Function Calls - Description: - - The production CallExpression : MemberExpression Arguments is evaluated as - follows: - - 1.Evaluate MemberExpression. - 2.Evaluate Arguments, producing an internal list of argument values - (section 0). - 3.Call GetValue(Result(1)). - 4.If Type(Result(3)) is not Object, generate a runtime error. - 5.If Result(3) does not implement the internal [[Call]] method, generate a - runtime error. - 6.If Type(Result(1)) is Reference, Result(6) is GetBase(Result(1)). Otherwise, - Result(6) is null. - 7.If Result(6) is an activation object, Result(7) is null. Otherwise, Result(7) is - the same as Result(6). - 8.Call the [[Call]] method on Result(3), providing Result(7) as the this value - and providing the list Result(2) as the argument values. - 9.Return Result(8). - - The production CallExpression : CallExpression Arguments is evaluated in - exactly the same manner, except that the contained CallExpression is - evaluated in step 1. - - Note: Result(8) will never be of type Reference if Result(3) is a native - ECMAScript object. Whether calling a host object can return a value of - type Reference is implementation-dependent. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - - var SECTION = "11.2.3-2-n.js"; - var VERSION = "ECMA_1"; - startTest(); - var TITLE = "Function Calls"; - - writeHeaderToLog( SECTION + " "+ TITLE); - - var testcases = new Array(); - - testcases[tc++] = new TestCase( SECTION, - "3.valueOf()", - 3, - 3.valueOf() ); - - testcases[tc++] = new TestCase( SECTION, - "(3).valueOf()", - 3, - (3).valueOf() ); - - 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 ); -} diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.3-3-n.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.3-3-n.js deleted file mode 100644 index da58907..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.3-3-n.js +++ /dev/null @@ -1,81 +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: 11.2.3-3-n.js - ECMA Section: 11.2.3. Function Calls - Description: - - The production CallExpression : MemberExpression Arguments is evaluated as - follows: - - 1.Evaluate MemberExpression. - 2.Evaluate Arguments, producing an internal list of argument values - (section 0). - 3.Call GetValue(Result(1)). - 4.If Type(Result(3)) is not Object, generate a runtime error. - 5.If Result(3) does not implement the internal [[Call]] method, generate a - runtime error. - 6.If Type(Result(1)) is Reference, Result(6) is GetBase(Result(1)). Otherwise, - Result(6) is null. - 7.If Result(6) is an activation object, Result(7) is null. Otherwise, Result(7) is - the same as Result(6). - 8.Call the [[Call]] method on Result(3), providing Result(7) as the this value - and providing the list Result(2) as the argument values. - 9.Return Result(8). - - The production CallExpression : CallExpression Arguments is evaluated in - exactly the same manner, except that the contained CallExpression is - evaluated in step 1. - - Note: Result(8) will never be of type Reference if Result(3) is a native - ECMAScript object. Whether calling a host object can return a value of - type Reference is implementation-dependent. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - - var SECTION = "11.2.3-3-n.js"; - var VERSION = "ECMA_1"; - startTest(); - var TITLE = "Function Calls"; - - writeHeaderToLog( SECTION + " "+ TITLE); - - var testcases = new Array(); - - testcases[tc++] = new TestCase( SECTION, "(void 0).valueOf()", "error", (void 0).valueOf() ); - 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 ); -} diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.3-4-n.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.3-4-n.js deleted file mode 100644 index eed49b2..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.3-4-n.js +++ /dev/null @@ -1,81 +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: 11.2.3-4-n.js - ECMA Section: 11.2.3. Function Calls - Description: - - The production CallExpression : MemberExpression Arguments is evaluated as - follows: - - 1.Evaluate MemberExpression. - 2.Evaluate Arguments, producing an internal list of argument values - (section 0). - 3.Call GetValue(Result(1)). - 4.If Type(Result(3)) is not Object, generate a runtime error. - 5.If Result(3) does not implement the internal [[Call]] method, generate a - runtime error. - 6.If Type(Result(1)) is Reference, Result(6) is GetBase(Result(1)). Otherwise, - Result(6) is null. - 7.If Result(6) is an activation object, Result(7) is null. Otherwise, Result(7) is - the same as Result(6). - 8.Call the [[Call]] method on Result(3), providing Result(7) as the this value - and providing the list Result(2) as the argument values. - 9.Return Result(8). - - The production CallExpression : CallExpression Arguments is evaluated in - exactly the same manner, except that the contained CallExpression is - evaluated in step 1. - - Note: Result(8) will never be of type Reference if Result(3) is a native - ECMAScript object. Whether calling a host object can return a value of - type Reference is implementation-dependent. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - - var SECTION = "11.2.3-4-n.js"; - var VERSION = "ECMA_1"; - startTest(); - var TITLE = "Function Calls"; - - writeHeaderToLog( SECTION + " "+ TITLE); - - var testcases = new Array(); - - testcases[tc++] = new TestCase( SECTION, "null.valueOf()", "error", null.valueOf() ); - 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 ); -} diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.3-5.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.3-5.js deleted file mode 100644 index 77a0f6c..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.2.3-5.js +++ /dev/null @@ -1,81 +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: 11.2.3-5-n.js - ECMA Section: 11.2.3. Function Calls - Description: - - The production CallExpression : MemberExpression Arguments is evaluated as - follows: - - 1. Evaluate MemberExpression. - 2. Evaluate Arguments, producing an internal list of argument values - (section 0). - 3. Call GetValue(Result(1)). - 4. If Type(Result(3)) is not Object, generate a runtime error. - 5. If Result(3) does not implement the internal [[Call]] method, generate a - runtime error. - 6. If Type(Result(1)) is Reference, Result(6) is GetBase(Result(1)). Otherwise, - Result(6) is null. - 7. If Result(6) is an activation object, Result(7) is null. Otherwise, Result(7) is - the same as Result(6). - 8. Call the [[Call]] method on Result(3), providing Result(7) as the this value - and providing the list Result(2) as the argument values. - 9. Return Result(8). - - The production CallExpression : CallExpression Arguments is evaluated in - exactly the same manner, except that the contained CallExpression is - evaluated in step 1. - - Note: Result(8) will never be of type Reference if Result(3) is a native - ECMAScript object. Whether calling a host object can return a value of - type Reference is implementation-dependent. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - - var SECTION = "11.2.3-5"; - var VERSION = "ECMA_1"; - startTest(); - var TITLE = "Function Calls"; - - writeHeaderToLog( SECTION + " "+ TITLE); - - var testcases = new Array(); - - testcases[tc++] = new TestCase( SECTION, "true.valueOf()", true, true.valueOf() ); - 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 ); -} diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.3.1.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.3.1.js deleted file mode 100644 index 0e1e8aa..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.3.1.js +++ /dev/null @@ -1,154 +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: 11.3.1.js - ECMA Section: 11.3.1 Postfix increment operator - Description: - The production MemberExpression : MemberExpression ++ is evaluated as - follows: - - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Call ToNumber(Result(2)). - 4. Add the value 1 to Result(3), using the same rules as for the + - operator (section 0). - 5. Call PutValue(Result(1), Result(4)). - 6. Return Result(3). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.3.1"; - var VERSION = "ECMA_1"; - startTest(); - - writeHeaderToLog( SECTION + " Postfix increment operator"); - - testcases = 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(); - var item = 0; - - // special numbers - array[item++] = new TestCase( SECTION, "var MYVAR; MYVAR++", NaN, eval("var MYVAR; MYVAR++") ); - array[item++] = new TestCase( SECTION, "var MYVAR= void 0; MYVAR++", NaN, eval("var MYVAR=void 0; MYVAR++") ); - array[item++] = new TestCase( SECTION, "var MYVAR=null; MYVAR++", 0, eval("var MYVAR=null; MYVAR++") ); - array[item++] = new TestCase( SECTION, "var MYVAR=true; MYVAR++", 1, eval("var MYVAR=true; MYVAR++") ); - array[item++] = new TestCase( SECTION, "var MYVAR=false; MYVAR++", 0, eval("var MYVAR=false; MYVAR++") ); - - // verify return value - - array[item++] = new TestCase( SECTION, "var MYVAR=Number.POSITIVE_INFINITY;MYVAR++", Number.POSITIVE_INFINITY, eval("var MYVAR=Number.POSITIVE_INFINITY;MYVAR++") ); - array[item++] = new TestCase( SECTION, "var MYVAR=Number.NEGATIVE_INFINITY;MYVAR++", Number.NEGATIVE_INFINITY, eval("var MYVAR=Number.NEGATIVE_INFINITY;MYVAR++") ); - array[item++] = new TestCase( SECTION, "var MYVAR=Number.NaN;MYVAR++", Number.NaN, eval("var MYVAR=Number.NaN;MYVAR++") ); - - // verify value of variable - - array[item++] = new TestCase( SECTION, "var MYVAR=Number.POSITIVE_INFINITY;MYVAR++;MYVAR", Number.POSITIVE_INFINITY, eval("var MYVAR=Number.POSITIVE_INFINITY;MYVAR++;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=Number.NEGATIVE_INFINITY;MYVAR++;MYVAR", Number.NEGATIVE_INFINITY, eval("var MYVAR=Number.NEGATIVE_INFINITY;MYVAR++;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=Number.NaN;MYVAR++;MYVAR", Number.NaN, eval("var MYVAR=Number.NaN;MYVAR++;MYVAR") ); - - // number primitives - array[item++] = new TestCase( SECTION, "var MYVAR=0;MYVAR++", 0, eval("var MYVAR=0;MYVAR++") ); - array[item++] = new TestCase( SECTION, "var MYVAR=0.2345;MYVAR++", 0.2345, eval("var MYVAR=0.2345;MYVAR++") ); - array[item++] = new TestCase( SECTION, "var MYVAR=-0.2345;MYVAR++", -0.2345, eval("var MYVAR=-0.2345;MYVAR++") ); - - // verify value of variable - - array[item++] = new TestCase( SECTION, "var MYVAR=0;MYVAR++;MYVAR", 1, eval("var MYVAR=0;MYVAR++;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=0.2345;MYVAR++;MYVAR", 1.2345, eval("var MYVAR=0.2345;MYVAR++;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=-0.2345;MYVAR++;MYVAR", 0.7655, eval("var MYVAR=-0.2345;MYVAR++;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=0;MYVAR++;MYVAR", 1, eval("var MYVAR=0;MYVAR++;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=0;MYVAR++;MYVAR", 1, eval("var MYVAR=0;MYVAR++;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=0;MYVAR++;MYVAR", 1, eval("var MYVAR=0;MYVAR++;MYVAR") ); - - // boolean values - // verify return value - - array[item++] = new TestCase( SECTION, "var MYVAR=true;MYVAR++", 1, eval("var MYVAR=true;MYVAR++") ); - array[item++] = new TestCase( SECTION, "var MYVAR=false;MYVAR++", 0, eval("var MYVAR=false;MYVAR++") ); - // verify value of variable - - array[item++] = new TestCase( SECTION, "var MYVAR=true;MYVAR++;MYVAR", 2, eval("var MYVAR=true;MYVAR++;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=false;MYVAR++;MYVAR", 1, eval("var MYVAR=false;MYVAR++;MYVAR") ); - - // boolean objects - // verify return value - - array[item++] = new TestCase( SECTION, "var MYVAR=new Boolean(true);MYVAR++", 1, eval("var MYVAR=true;MYVAR++") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new Boolean(false);MYVAR++", 0, eval("var MYVAR=false;MYVAR++") ); - // verify value of variable - - array[item++] = new TestCase( SECTION, "var MYVAR=new Boolean(true);MYVAR++;MYVAR", 2, eval("var MYVAR=new Boolean(true);MYVAR++;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new Boolean(false);MYVAR++;MYVAR", 1, eval("var MYVAR=new Boolean(false);MYVAR++;MYVAR") ); - - // string primitives - array[item++] = new TestCase( SECTION, "var MYVAR='string';MYVAR++", Number.NaN, eval("var MYVAR='string';MYVAR++") ); - array[item++] = new TestCase( SECTION, "var MYVAR='12345';MYVAR++", 12345, eval("var MYVAR='12345';MYVAR++") ); - array[item++] = new TestCase( SECTION, "var MYVAR='-12345';MYVAR++", -12345, eval("var MYVAR='-12345';MYVAR++") ); - array[item++] = new TestCase( SECTION, "var MYVAR='0Xf';MYVAR++", 15, eval("var MYVAR='0Xf';MYVAR++") ); - array[item++] = new TestCase( SECTION, "var MYVAR='077';MYVAR++", 77, eval("var MYVAR='077';MYVAR++") ); - array[item++] = new TestCase( SECTION, "var MYVAR=''; MYVAR++", 0, eval("var MYVAR='';MYVAR++") ); - - // verify value of variable - - array[item++] = new TestCase( SECTION, "var MYVAR='string';MYVAR++;MYVAR", Number.NaN, eval("var MYVAR='string';MYVAR++;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR='12345';MYVAR++;MYVAR", 12346, eval("var MYVAR='12345';MYVAR++;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR='-12345';MYVAR++;MYVAR", -12344, eval("var MYVAR='-12345';MYVAR++;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR='0xf';MYVAR++;MYVAR", 16, eval("var MYVAR='0xf';MYVAR++;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR='077';MYVAR++;MYVAR", 78, eval("var MYVAR='077';MYVAR++;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR='';MYVAR++;MYVAR", 1, eval("var MYVAR='';MYVAR++;MYVAR") ); - - // string objects - array[item++] = new TestCase( SECTION, "var MYVAR=new String('string');MYVAR++", Number.NaN, eval("var MYVAR=new String('string');MYVAR++") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String('12345');MYVAR++", 12345, eval("var MYVAR=new String('12345');MYVAR++") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String('-12345');MYVAR++", -12345, eval("var MYVAR=new String('-12345');MYVAR++") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String('0Xf');MYVAR++", 15, eval("var MYVAR=new String('0Xf');MYVAR++") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String('077');MYVAR++", 77, eval("var MYVAR=new String('077');MYVAR++") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String(''); MYVAR++", 0, eval("var MYVAR=new String('');MYVAR++") ); - - // verify value of variable - - array[item++] = new TestCase( SECTION, "var MYVAR=new String('string');MYVAR++;MYVAR", Number.NaN, eval("var MYVAR=new String('string');MYVAR++;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String('12345');MYVAR++;MYVAR", 12346, eval("var MYVAR=new String('12345');MYVAR++;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String('-12345');MYVAR++;MYVAR", -12344, eval("var MYVAR=new String('-12345');MYVAR++;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String('0xf');MYVAR++;MYVAR", 16, eval("var MYVAR=new String('0xf');MYVAR++;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String('077');MYVAR++;MYVAR", 78, eval("var MYVAR=new String('077');MYVAR++;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String('');MYVAR++;MYVAR", 1, eval("var MYVAR=new String('');MYVAR++;MYVAR") ); - - return ( array ); -} diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.3.2.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.3.2.js deleted file mode 100644 index 1042f85..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.3.2.js +++ /dev/null @@ -1,154 +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: 11.3.2.js - ECMA Section: 11.3.2 Postfix decrement operator - Description: - - 11.3.2 Postfix decrement operator - - The production MemberExpression : MemberExpression -- is evaluated as follows: - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Call ToNumber(Result(2)). - 4. Subtract the value 1 from Result(3), using the same rules as for the - - operator (section 0). - 5. Call PutValue(Result(1), Result(4)). - 6. Return Result(3). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.3.2"; - var VERSION = "ECMA_1"; - startTest(); - var testcases = getTestCases(); - - writeHeaderToLog( SECTION + " Postfix decrement operator"); - 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(); - var item = 0; - - // special numbers - array[item++] = new TestCase( SECTION, "var MYVAR; MYVAR--", NaN, eval("var MYVAR; MYVAR--") ); - array[item++] = new TestCase( SECTION, "var MYVAR= void 0; MYVAR--", NaN, eval("var MYVAR=void 0; MYVAR--") ); - array[item++] = new TestCase( SECTION, "var MYVAR=null; MYVAR--", 0, eval("var MYVAR=null; MYVAR--") ); - array[item++] = new TestCase( SECTION, "var MYVAR=true; MYVAR--", 1, eval("var MYVAR=true; MYVAR--") ); - array[item++] = new TestCase( SECTION, "var MYVAR=false; MYVAR--", 0, eval("var MYVAR=false; MYVAR--") ); - - // verify return value - - array[item++] = new TestCase( SECTION, "var MYVAR=Number.POSITIVE_INFINITY;MYVAR--", Number.POSITIVE_INFINITY, eval("var MYVAR=Number.POSITIVE_INFINITY;MYVAR--") ); - array[item++] = new TestCase( SECTION, "var MYVAR=Number.NEGATIVE_INFINITY;MYVAR--", Number.NEGATIVE_INFINITY, eval("var MYVAR=Number.NEGATIVE_INFINITY;MYVAR--") ); - array[item++] = new TestCase( SECTION, "var MYVAR=Number.NaN;MYVAR--", Number.NaN, eval("var MYVAR=Number.NaN;MYVAR--") ); - - // verify value of variable - - array[item++] = new TestCase( SECTION, "var MYVAR=Number.POSITIVE_INFINITY;MYVAR--;MYVAR", Number.POSITIVE_INFINITY, eval("var MYVAR=Number.POSITIVE_INFINITY;MYVAR--;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=Number.NEGATIVE_INFINITY;MYVAR--;MYVAR", Number.NEGATIVE_INFINITY, eval("var MYVAR=Number.NEGATIVE_INFINITY;MYVAR--;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=Number.NaN;MYVAR--;MYVAR", Number.NaN, eval("var MYVAR=Number.NaN;MYVAR--;MYVAR") ); - - // number primitives - array[item++] = new TestCase( SECTION, "var MYVAR=0;MYVAR--", 0, eval("var MYVAR=0;MYVAR--") ); - array[item++] = new TestCase( SECTION, "var MYVAR=0.2345;MYVAR--", 0.2345, eval("var MYVAR=0.2345;MYVAR--") ); - array[item++] = new TestCase( SECTION, "var MYVAR=-0.2345;MYVAR--", -0.2345, eval("var MYVAR=-0.2345;MYVAR--") ); - - // verify value of variable - - array[item++] = new TestCase( SECTION, "var MYVAR=0;MYVAR--;MYVAR", -1, eval("var MYVAR=0;MYVAR--;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=0.2345;MYVAR--;MYVAR", -0.7655, eval("var MYVAR=0.2345;MYVAR--;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=-0.2345;MYVAR--;MYVAR", -1.2345, eval("var MYVAR=-0.2345;MYVAR--;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=0;MYVAR--;MYVAR", -1, eval("var MYVAR=0;MYVAR--;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=0;MYVAR--;MYVAR", -1, eval("var MYVAR=0;MYVAR--;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=0;MYVAR--;MYVAR", -1, eval("var MYVAR=0;MYVAR--;MYVAR") ); - - // boolean values - // verify return value - - array[item++] = new TestCase( SECTION, "var MYVAR=true;MYVAR--", 1, eval("var MYVAR=true;MYVAR--") ); - array[item++] = new TestCase( SECTION, "var MYVAR=false;MYVAR--", 0, eval("var MYVAR=false;MYVAR--") ); - // verify value of variable - - array[item++] = new TestCase( SECTION, "var MYVAR=true;MYVAR--;MYVAR", 0, eval("var MYVAR=true;MYVAR--;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=false;MYVAR--;MYVAR", -1, eval("var MYVAR=false;MYVAR--;MYVAR") ); - - // boolean objects - // verify return value - - array[item++] = new TestCase( SECTION, "var MYVAR=new Boolean(true);MYVAR--", 1, eval("var MYVAR=true;MYVAR--") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new Boolean(false);MYVAR--", 0, eval("var MYVAR=false;MYVAR--") ); - // verify value of variable - - array[item++] = new TestCase( SECTION, "var MYVAR=new Boolean(true);MYVAR--;MYVAR", 0, eval("var MYVAR=new Boolean(true);MYVAR--;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new Boolean(false);MYVAR--;MYVAR", -1, eval("var MYVAR=new Boolean(false);MYVAR--;MYVAR") ); - - // string primitives - array[item++] = new TestCase( SECTION, "var MYVAR='string';MYVAR--", Number.NaN, eval("var MYVAR='string';MYVAR--") ); - array[item++] = new TestCase( SECTION, "var MYVAR='12345';MYVAR--", 12345, eval("var MYVAR='12345';MYVAR--") ); - array[item++] = new TestCase( SECTION, "var MYVAR='-12345';MYVAR--", -12345, eval("var MYVAR='-12345';MYVAR--") ); - array[item++] = new TestCase( SECTION, "var MYVAR='0Xf';MYVAR--", 15, eval("var MYVAR='0Xf';MYVAR--") ); - array[item++] = new TestCase( SECTION, "var MYVAR='077';MYVAR--", 77, eval("var MYVAR='077';MYVAR--") ); - array[item++] = new TestCase( SECTION, "var MYVAR=''; MYVAR--", 0, eval("var MYVAR='';MYVAR--") ); - - // verify value of variable - - array[item++] = new TestCase( SECTION, "var MYVAR='string';MYVAR--;MYVAR", Number.NaN, eval("var MYVAR='string';MYVAR--;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR='12345';MYVAR--;MYVAR", 12344, eval("var MYVAR='12345';MYVAR--;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR='-12345';MYVAR--;MYVAR", -12346, eval("var MYVAR='-12345';MYVAR--;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR='0xf';MYVAR--;MYVAR", 14, eval("var MYVAR='0xf';MYVAR--;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR='077';MYVAR--;MYVAR", 76, eval("var MYVAR='077';MYVAR--;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR='';MYVAR--;MYVAR", -1, eval("var MYVAR='';MYVAR--;MYVAR") ); - - // string objects - array[item++] = new TestCase( SECTION, "var MYVAR=new String('string');MYVAR--", Number.NaN, eval("var MYVAR=new String('string');MYVAR--") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String('12345');MYVAR--", 12345, eval("var MYVAR=new String('12345');MYVAR--") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String('-12345');MYVAR--", -12345, eval("var MYVAR=new String('-12345');MYVAR--") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String('0Xf');MYVAR--", 15, eval("var MYVAR=new String('0Xf');MYVAR--") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String('077');MYVAR--", 77, eval("var MYVAR=new String('077');MYVAR--") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String(''); MYVAR--", 0, eval("var MYVAR=new String('');MYVAR--") ); - - // verify value of variable - - array[item++] = new TestCase( SECTION, "var MYVAR=new String('string');MYVAR--;MYVAR", Number.NaN, eval("var MYVAR=new String('string');MYVAR--;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String('12345');MYVAR--;MYVAR", 12344, eval("var MYVAR=new String('12345');MYVAR--;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String('-12345');MYVAR--;MYVAR", -12346, eval("var MYVAR=new String('-12345');MYVAR--;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String('0xf');MYVAR--;MYVAR", 14, eval("var MYVAR=new String('0xf');MYVAR--;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String('077');MYVAR--;MYVAR", 76, eval("var MYVAR=new String('077');MYVAR--;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String('');MYVAR--;MYVAR", -1, eval("var MYVAR=new String('');MYVAR--;MYVAR") ); - - return ( array ); -} diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.4.1.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.4.1.js deleted file mode 100644 index 766b786..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.4.1.js +++ /dev/null @@ -1,95 +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: 11.4.1.js - ECMA Section: 11.4.1 the Delete Operator - Description: returns true if the property could be deleted - returns false if it could not be deleted - Author: christine@netscape.com - Date: 7 july 1997 - -*/ - - - var SECTION = "11.4.1"; - var VERSION = "ECMA_1"; - startTest(); - var TITLE = "The delete operator"; - - writeHeaderToLog( SECTION + " "+ TITLE); - - var testcases = getTestCases(); - - test(); - -function getTestCases() { - var array = new Array(); - var item = 0; - -// array[item++] = new TestCase( SECTION, "x=[9,8,7];delete(x[2]);x.length", 2, eval("x=[9,8,7];delete(x[2]);x.length") ); -// array[item++] = new TestCase( SECTION, "x=[9,8,7];delete(x[2]);x.toString()", "9,8", eval("x=[9,8,7];delete(x[2]);x.toString()") ); - array[item++] = new TestCase( SECTION, "x=new Date();delete x;typeof(x)", "undefined", eval("x=new Date();delete x;typeof(x)") ); - -// array[item++] = new TestCase( SECTION, "delete(x=new Date())", true, delete(x=new Date()) ); -// array[item++] = new TestCase( SECTION, "delete('string primitive')", true, delete("string primitive") ); -// array[item++] = new TestCase( SECTION, "delete(new String( 'string object' ) )", true, delete(new String("string object")) ); -// array[item++] = new TestCase( SECTION, "delete(new Number(12345) )", true, delete(new Number(12345)) ); - array[item++] = new TestCase( SECTION, "delete(Math.PI)", false, delete(Math.PI) ); -// array[item++] = new TestCase( SECTION, "delete(null)", true, delete(null) ); -// array[item++] = new TestCase( SECTION, "delete(void(0))", true, delete(void(0)) ); - - // variables declared with the var statement are not deletable. - - var abc; - array[item++] = new TestCase( SECTION, "var abc; delete(abc)", false, delete abc ); - - array[item++] = new TestCase( SECTION, - "var OB = new MyObject(); for ( p in OB ) { delete p }", - true, - eval("var OB = new MyObject(); for ( p in OB ) { delete p }") ); - 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 MyObject() { - this.prop1 = true; - this.prop2 = false; - this.prop3 = null - this.prop4 = void 0; - this.prop5 = "hi"; - this.prop6 = 42; - this.prop7 = new Date(); - this.prop8 = Math.PI; -}
\ No newline at end of file diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.4.2.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.4.2.js deleted file mode 100644 index c889ec6..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.4.2.js +++ /dev/null @@ -1,85 +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: 11.4.2.js - ECMA Section: 11.4.2 the Void Operator - Description: always returns undefined (?) - Author: christine@netscape.com - Date: 7 july 1997 - -*/ - var SECTION = "11.4.2"; - var VERSION = "ECMA_1"; - startTest(); - var TITLE = "The void operator"; - - writeHeaderToLog( SECTION + " "+ TITLE); - - var testcases = getTestCases(); - - test(); - -function getTestCases() { - var array = new Array(); - var item = 0; - - array[item++] = new TestCase( SECTION, "void(new String('string object'))", void 0, void(new String( 'string object' )) ); - array[item++] = new TestCase( SECTION, "void('string primitive')", void 0, void("string primitive") ); - array[item++] = new TestCase( SECTION, "void(Number.NaN)", void 0, void(Number.NaN) ); - array[item++] = new TestCase( SECTION, "void(Number.POSITIVE_INFINITY)", void 0, void(Number.POSITIVE_INFINITY) ); - array[item++] = new TestCase( SECTION, "void(1)", void 0, void(1) ); - array[item++] = new TestCase( SECTION, "void(0)", void 0, void(0) ); - array[item++] = new TestCase( SECTION, "void(-1)", void 0, void(-1) ); - array[item++] = new TestCase( SECTION, "void(Number.NEGATIVE_INFINITY)", void 0, void(Number.NEGATIVE_INFINITY) ); - array[item++] = new TestCase( SECTION, "void(Math.PI)", void 0, void(Math.PI) ); - array[item++] = new TestCase( SECTION, "void(true)", void 0, void(true) ); - array[item++] = new TestCase( SECTION, "void(false)", void 0, void(false) ); - array[item++] = new TestCase( SECTION, "void(null)", void 0, void(null) ); - array[item++] = new TestCase( SECTION, "void new String('string object')", void 0, void new String( 'string object' ) ); - array[item++] = new TestCase( SECTION, "void 'string primitive'", void 0, void "string primitive" ); - array[item++] = new TestCase( SECTION, "void Number.NaN", void 0, void Number.NaN ); - array[item++] = new TestCase( SECTION, "void Number.POSITIVE_INFINITY", void 0, void Number.POSITIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "void 1", void 0, void 1 ); - array[item++] = new TestCase( SECTION, "void 0", void 0, void 0 ); - array[item++] = new TestCase( SECTION, "void -1", void 0, void -1 ); - array[item++] = new TestCase( SECTION, "void Number.NEGATIVE_INFINITY", void 0, void Number.NEGATIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "void Math.PI", void 0, void Math.PI ); - array[item++] = new TestCase( SECTION, "void true", void 0, void true ); - array[item++] = new TestCase( SECTION, "void false", void 0, void false ); - array[item++] = new TestCase( SECTION, "void null", void 0, void null ); - -// array[item++] = new TestCase( SECTION, "void()", void 0, void() ); - - return ( array ); -} - -function test() { - for ( i = 0; i < testcases.length; i++ ) { - testcases[i].passed = writeTestCaseResult( - testcases[i].expect, - testcases[i].actual, - testcases[i].description +" = "+ testcases[i].actual ); - testcases[i].reason += ( testcases[i].passed ) ? "" : "wrong value " - } - stopTest(); - return ( testcases ); -} diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.4.3.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.4.3.js deleted file mode 100644 index eccfa0d..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.4.3.js +++ /dev/null @@ -1,109 +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: typeof_1.js - ECMA Section: 11.4.3 typeof operator - Description: typeof evaluates unary expressions: - undefined "undefined" - null "object" - Boolean "boolean" - Number "number" - String "string" - Object "object" [native, doesn't implement Call] - Object "function" [native, implements [Call]] - Object implementation dependent - [not sure how to test this] - Author: christine@netscape.com - Date: june 30, 1997 - -*/ - - var SECTION = "11.4.3"; - - var VERSION = "ECMA_1"; - startTest(); - var TITLE = " The typeof operator"; - - var testcases = new Array(); - - - testcases[testcases.length] = new TestCase( SECTION, "typeof(void(0))", "undefined", typeof(void(0)) ); - testcases[testcases.length] = new TestCase( SECTION, "typeof(null)", "object", typeof(null) ); - testcases[testcases.length] = new TestCase( SECTION, "typeof(true)", "boolean", typeof(true) ); - testcases[testcases.length] = new TestCase( SECTION, "typeof(false)", "boolean", typeof(false) ); - testcases[testcases.length] = new TestCase( SECTION, "typeof(new Boolean())", "object", typeof(new Boolean()) ); - testcases[testcases.length] = new TestCase( SECTION, "typeof(new Boolean(true))", "object", typeof(new Boolean(true)) ); - testcases[testcases.length] = new TestCase( SECTION, "typeof(Boolean())", "boolean", typeof(Boolean()) ); - testcases[testcases.length] = new TestCase( SECTION, "typeof(Boolean(false))", "boolean", typeof(Boolean(false)) ); - testcases[testcases.length] = new TestCase( SECTION, "typeof(Boolean(true))", "boolean", typeof(Boolean(true)) ); - testcases[testcases.length] = new TestCase( SECTION, "typeof(NaN)", "number", typeof(Number.NaN) ); - testcases[testcases.length] = new TestCase( SECTION, "typeof(Infinity)", "number", typeof(Number.POSITIVE_INFINITY) ); - testcases[testcases.length] = new TestCase( SECTION, "typeof(-Infinity)", "number", typeof(Number.NEGATIVE_INFINITY) ); - testcases[testcases.length] = new TestCase( SECTION, "typeof(Math.PI)", "number", typeof(Math.PI) ); - testcases[testcases.length] = new TestCase( SECTION, "typeof(0)", "number", typeof(0) ); - testcases[testcases.length] = new TestCase( SECTION, "typeof(1)", "number", typeof(1) ); - testcases[testcases.length] = new TestCase( SECTION, "typeof(-1)", "number", typeof(-1) ); - testcases[testcases.length] = new TestCase( SECTION, "typeof('0')", "string", typeof("0") ); - testcases[testcases.length] = new TestCase( SECTION, "typeof(Number())", "number", typeof(Number()) ); - testcases[testcases.length] = new TestCase( SECTION, "typeof(Number(0))", "number", typeof(Number(0)) ); - testcases[testcases.length] = new TestCase( SECTION, "typeof(Number(1))", "number", typeof(Number(1)) ); - testcases[testcases.length] = new TestCase( SECTION, "typeof(Nubmer(-1))", "number", typeof(Number(-1)) ); - testcases[testcases.length] = new TestCase( SECTION, "typeof(new Number())", "object", typeof(new Number()) ); - testcases[testcases.length] = new TestCase( SECTION, "typeof(new Number(0))", "object", typeof(new Number(0)) ); - testcases[testcases.length] = new TestCase( SECTION, "typeof(new Number(1))", "object", typeof(new Number(1)) ); - - // Math does not implement [[Construct]] or [[Call]] so its type is object. - - testcases[testcases.length] = new TestCase( SECTION, "typeof(Math)", "object", typeof(Math) ); - - testcases[testcases.length] = new TestCase( SECTION, "typeof(Number.prototype.toString)", "function", typeof(Number.prototype.toString) ); - - testcases[testcases.length] = new TestCase( SECTION, "typeof('a string')", "string", typeof("a string") ); - testcases[testcases.length] = new TestCase( SECTION, "typeof('')", "string", typeof("") ); - testcases[testcases.length] = new TestCase( SECTION, "typeof(new Date())", "object", typeof(new Date()) ); - testcases[testcases.length] = new TestCase( SECTION, "typeof(new Array(1,2,3))", "object", typeof(new Array(1,2,3)) ); - testcases[testcases.length] = new TestCase( SECTION, "typeof(new String('string object'))", "object", typeof(new String("string object")) ); - testcases[testcases.length] = new TestCase( SECTION, "typeof(String('string primitive'))", "string", typeof(String("string primitive")) ); - testcases[testcases.length] = new TestCase( SECTION, "typeof(['array', 'of', 'strings'])", "object", typeof(["array", "of", "strings"]) ); - testcases[testcases.length] = new TestCase( SECTION, "typeof(new Function())", "function", typeof( new Function() ) ); - testcases[testcases.length] = new TestCase( SECTION, "typeof(parseInt)", "function", typeof( parseInt ) ); - testcases[testcases.length] = new TestCase( SECTION, "typeof(test)", "function", typeof( test ) ); - testcases[testcases.length] = new TestCase( SECTION, "typeof(String.fromCharCode)", "function", typeof( String.fromCharCode ) ); - - - writeHeaderToLog( SECTION + " "+ TITLE); - 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 ); -} diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.4.4.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.4.4.js deleted file mode 100644 index 7a7a547..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.4.4.js +++ /dev/null @@ -1,156 +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: 11.4.4.js - ECMA Section: 11.4.4 Prefix increment operator - Description: - The production UnaryExpression : ++ UnaryExpression is evaluated as - follows: - - 1. Evaluate UnaryExpression. - 2. Call GetValue(Result(1)). - 3. Call ToNumber(Result(2)). - 4. Add the value 1 to Result(3), using the same rules as for the + - operator (section 11.6.3). - 5. Call PutValue(Result(1), Result(4)). - 6. Return Result(4). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.4.4"; - var VERSION = "ECMA_1"; - startTest(); - var testcases = getTestCases(); - - writeHeaderToLog( SECTION + " Prefix increment operator"); - 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(); - var item = 0; - - // special case: var is not defined - - array[item++] = new TestCase( SECTION, "var MYVAR; ++MYVAR", NaN, eval("var MYVAR; ++MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR= void 0; ++MYVAR", NaN, eval("var MYVAR=void 0; ++MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=null; ++MYVAR", 1, eval("var MYVAR=null; ++MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=true; ++MYVAR", 2, eval("var MYVAR=true; ++MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=false; ++MYVAR", 1, eval("var MYVAR=false; ++MYVAR") ); - - // special numbers - // verify return value - - array[item++] = new TestCase( SECTION, "var MYVAR=Number.POSITIVE_INFINITY;++MYVAR", Number.POSITIVE_INFINITY, eval("var MYVAR=Number.POSITIVE_INFINITY;++MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=Number.NEGATIVE_INFINITY;++MYVAR", Number.NEGATIVE_INFINITY, eval("var MYVAR=Number.NEGATIVE_INFINITY;++MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=Number.NaN;++MYVAR", Number.NaN, eval("var MYVAR=Number.NaN;++MYVAR") ); - - // verify value of variable - - array[item++] = new TestCase( SECTION, "var MYVAR=Number.POSITIVE_INFINITY;++MYVAR;MYVAR", Number.POSITIVE_INFINITY, eval("var MYVAR=Number.POSITIVE_INFINITY;++MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=Number.NEGATIVE_INFINITY;++MYVAR;MYVAR", Number.NEGATIVE_INFINITY, eval("var MYVAR=Number.NEGATIVE_INFINITY;++MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=Number.NaN;++MYVAR;MYVAR", Number.NaN, eval("var MYVAR=Number.NaN;++MYVAR;MYVAR") ); - - - // number primitives - array[item++] = new TestCase( SECTION, "var MYVAR=0;++MYVAR", 1, eval("var MYVAR=0;++MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=0.2345;++MYVAR", 1.2345, eval("var MYVAR=0.2345;++MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=-0.2345;++MYVAR", 0.7655, eval("var MYVAR=-0.2345;++MYVAR") ); - - // verify value of variable - - array[item++] = new TestCase( SECTION, "var MYVAR=0;++MYVAR;MYVAR", 1, eval("var MYVAR=0;++MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=0.2345;++MYVAR;MYVAR", 1.2345, eval("var MYVAR=0.2345;++MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=-0.2345;++MYVAR;MYVAR", 0.7655, eval("var MYVAR=-0.2345;++MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=0;++MYVAR;MYVAR", 1, eval("var MYVAR=0;++MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=0;++MYVAR;MYVAR", 1, eval("var MYVAR=0;++MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=0;++MYVAR;MYVAR", 1, eval("var MYVAR=0;++MYVAR;MYVAR") ); - - // boolean values - // verify return value - - array[item++] = new TestCase( SECTION, "var MYVAR=true;++MYVAR", 2, eval("var MYVAR=true;++MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=false;++MYVAR", 1, eval("var MYVAR=false;++MYVAR") ); - // verify value of variable - - array[item++] = new TestCase( SECTION, "var MYVAR=true;++MYVAR;MYVAR", 2, eval("var MYVAR=true;++MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=false;++MYVAR;MYVAR", 1, eval("var MYVAR=false;++MYVAR;MYVAR") ); - - // boolean objects - // verify return value - - array[item++] = new TestCase( SECTION, "var MYVAR=new Boolean(true);++MYVAR", 2, eval("var MYVAR=true;++MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new Boolean(false);++MYVAR", 1, eval("var MYVAR=false;++MYVAR") ); - // verify value of variable - - array[item++] = new TestCase( SECTION, "var MYVAR=new Boolean(true);++MYVAR;MYVAR", 2, eval("var MYVAR=new Boolean(true);++MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new Boolean(false);++MYVAR;MYVAR", 1, eval("var MYVAR=new Boolean(false);++MYVAR;MYVAR") ); - - // string primitives - array[item++] = new TestCase( SECTION, "var MYVAR='string';++MYVAR", Number.NaN, eval("var MYVAR='string';++MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR='12345';++MYVAR", 12346, eval("var MYVAR='12345';++MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR='-12345';++MYVAR", -12344, eval("var MYVAR='-12345';++MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR='0Xf';++MYVAR", 16, eval("var MYVAR='0Xf';++MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR='077';++MYVAR", 78, eval("var MYVAR='077';++MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=''; ++MYVAR", 1, eval("var MYVAR='';++MYVAR") ); - - // verify value of variable - - array[item++] = new TestCase( SECTION, "var MYVAR='string';++MYVAR;MYVAR", Number.NaN, eval("var MYVAR='string';++MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR='12345';++MYVAR;MYVAR", 12346, eval("var MYVAR='12345';++MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR='-12345';++MYVAR;MYVAR", -12344, eval("var MYVAR='-12345';++MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR='0xf';++MYVAR;MYVAR", 16, eval("var MYVAR='0xf';++MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR='077';++MYVAR;MYVAR", 78, eval("var MYVAR='077';++MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR='';++MYVAR;MYVAR", 1, eval("var MYVAR='';++MYVAR;MYVAR") ); - - // string objects - array[item++] = new TestCase( SECTION, "var MYVAR=new String('string');++MYVAR", Number.NaN, eval("var MYVAR=new String('string');++MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String('12345');++MYVAR", 12346, eval("var MYVAR=new String('12345');++MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String('-12345');++MYVAR", -12344, eval("var MYVAR=new String('-12345');++MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String('0Xf');++MYVAR", 16, eval("var MYVAR=new String('0Xf');++MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String('077');++MYVAR", 78, eval("var MYVAR=new String('077');++MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String(''); ++MYVAR", 1, eval("var MYVAR=new String('');++MYVAR") ); - - // verify value of variable - - array[item++] = new TestCase( SECTION, "var MYVAR=new String('string');++MYVAR;MYVAR", Number.NaN, eval("var MYVAR=new String('string');++MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String('12345');++MYVAR;MYVAR", 12346, eval("var MYVAR=new String('12345');++MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String('-12345');++MYVAR;MYVAR", -12344, eval("var MYVAR=new String('-12345');++MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String('0xf');++MYVAR;MYVAR", 16, eval("var MYVAR=new String('0xf');++MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String('077');++MYVAR;MYVAR", 78, eval("var MYVAR=new String('077');++MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String('');++MYVAR;MYVAR", 1, eval("var MYVAR=new String('');++MYVAR;MYVAR") ); - - return ( array ); -} diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.4.5.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.4.5.js deleted file mode 100644 index d82ac60..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.4.5.js +++ /dev/null @@ -1,154 +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: 11.4.5.js - ECMA Section: 11.4.5 Prefix decrement operator - Description: - - The production UnaryExpression : -- UnaryExpression is evaluated as follows: - - 1.Evaluate UnaryExpression. - 2.Call GetValue(Result(1)). - 3.Call ToNumber(Result(2)). - 4.Subtract the value 1 from Result(3), using the same rules as for the - operator (section 11.6.3). - 5.Call PutValue(Result(1), Result(4)). - - 1.Return Result(4). - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.4.5"; - var VERSION = "ECMA_1"; - startTest(); - var testcases = getTestCases(); - - writeHeaderToLog( SECTION + " Prefix decrement operator"); - 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(); - var item = 0; - - // - array[item++] = new TestCase( SECTION, "var MYVAR; --MYVAR", NaN, eval("var MYVAR; --MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR= void 0; --MYVAR", NaN, eval("var MYVAR=void 0; --MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=null; --MYVAR", -1, eval("var MYVAR=null; --MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=true; --MYVAR", 0, eval("var MYVAR=true; --MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=false; --MYVAR", -1, eval("var MYVAR=false; --MYVAR") ); - - // special numbers - // verify return value - - array[item++] = new TestCase( SECTION, "var MYVAR=Number.POSITIVE_INFINITY;--MYVAR", Number.POSITIVE_INFINITY, eval("var MYVAR=Number.POSITIVE_INFINITY;--MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=Number.NEGATIVE_INFINITY;--MYVAR", Number.NEGATIVE_INFINITY, eval("var MYVAR=Number.NEGATIVE_INFINITY;--MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=Number.NaN;--MYVAR", Number.NaN, eval("var MYVAR=Number.NaN;--MYVAR") ); - - // verify value of variable - - array[item++] = new TestCase( SECTION, "var MYVAR=Number.POSITIVE_INFINITY;--MYVAR;MYVAR", Number.POSITIVE_INFINITY, eval("var MYVAR=Number.POSITIVE_INFINITY;--MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=Number.NEGATIVE_INFINITY;--MYVAR;MYVAR", Number.NEGATIVE_INFINITY, eval("var MYVAR=Number.NEGATIVE_INFINITY;--MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=Number.NaN;--MYVAR;MYVAR", Number.NaN, eval("var MYVAR=Number.NaN;--MYVAR;MYVAR") ); - - - // number primitives - array[item++] = new TestCase( SECTION, "var MYVAR=0;--MYVAR", -1, eval("var MYVAR=0;--MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=0.2345;--MYVAR", -0.7655, eval("var MYVAR=0.2345;--MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=-0.2345;--MYVAR", -1.2345, eval("var MYVAR=-0.2345;--MYVAR") ); - - // verify value of variable - - array[item++] = new TestCase( SECTION, "var MYVAR=0;--MYVAR;MYVAR", -1, eval("var MYVAR=0;--MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=0.2345;--MYVAR;MYVAR", -0.7655, eval("var MYVAR=0.2345;--MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=-0.2345;--MYVAR;MYVAR", -1.2345, eval("var MYVAR=-0.2345;--MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=0;--MYVAR;MYVAR", -1, eval("var MYVAR=0;--MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=0;--MYVAR;MYVAR", -1, eval("var MYVAR=0;--MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=0;--MYVAR;MYVAR", -1, eval("var MYVAR=0;--MYVAR;MYVAR") ); - - // boolean values - // verify return value - - array[item++] = new TestCase( SECTION, "var MYVAR=true;--MYVAR", 0, eval("var MYVAR=true;--MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=false;--MYVAR", -1, eval("var MYVAR=false;--MYVAR") ); - // verify value of variable - - array[item++] = new TestCase( SECTION, "var MYVAR=true;--MYVAR;MYVAR", 0, eval("var MYVAR=true;--MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=false;--MYVAR;MYVAR", -1, eval("var MYVAR=false;--MYVAR;MYVAR") ); - - // boolean objects - // verify return value - - array[item++] = new TestCase( SECTION, "var MYVAR=new Boolean(true);--MYVAR", 0, eval("var MYVAR=true;--MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new Boolean(false);--MYVAR", -1, eval("var MYVAR=false;--MYVAR") ); - // verify value of variable - - array[item++] = new TestCase( SECTION, "var MYVAR=new Boolean(true);--MYVAR;MYVAR", 0, eval("var MYVAR=new Boolean(true);--MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new Boolean(false);--MYVAR;MYVAR", -1, eval("var MYVAR=new Boolean(false);--MYVAR;MYVAR") ); - - // string primitives - array[item++] = new TestCase( SECTION, "var MYVAR='string';--MYVAR", Number.NaN, eval("var MYVAR='string';--MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR='12345';--MYVAR", 12344, eval("var MYVAR='12345';--MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR='-12345';--MYVAR", -12346, eval("var MYVAR='-12345';--MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR='0Xf';--MYVAR", 14, eval("var MYVAR='0Xf';--MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR='077';--MYVAR", 76, eval("var MYVAR='077';--MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=''; --MYVAR", -1, eval("var MYVAR='';--MYVAR") ); - - // verify value of variable - - array[item++] = new TestCase( SECTION, "var MYVAR='string';--MYVAR;MYVAR", Number.NaN, eval("var MYVAR='string';--MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR='12345';--MYVAR;MYVAR", 12344, eval("var MYVAR='12345';--MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR='-12345';--MYVAR;MYVAR", -12346, eval("var MYVAR='-12345';--MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR='0xf';--MYVAR;MYVAR", 14, eval("var MYVAR='0xf';--MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR='077';--MYVAR;MYVAR", 76, eval("var MYVAR='077';--MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR='';--MYVAR;MYVAR", -1, eval("var MYVAR='';--MYVAR;MYVAR") ); - - // string objects - array[item++] = new TestCase( SECTION, "var MYVAR=new String('string');--MYVAR", Number.NaN, eval("var MYVAR=new String('string');--MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String('12345');--MYVAR", 12344, eval("var MYVAR=new String('12345');--MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String('-12345');--MYVAR", -12346, eval("var MYVAR=new String('-12345');--MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String('0Xf');--MYVAR", 14, eval("var MYVAR=new String('0Xf');--MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String('077');--MYVAR", 76, eval("var MYVAR=new String('077');--MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String(''); --MYVAR", -1, eval("var MYVAR=new String('');--MYVAR") ); - - // verify value of variable - - array[item++] = new TestCase( SECTION, "var MYVAR=new String('string');--MYVAR;MYVAR", Number.NaN, eval("var MYVAR=new String('string');--MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String('12345');--MYVAR;MYVAR", 12344, eval("var MYVAR=new String('12345');--MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String('-12345');--MYVAR;MYVAR", -12346, eval("var MYVAR=new String('-12345');--MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String('0xf');--MYVAR;MYVAR", 14, eval("var MYVAR=new String('0xf');--MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String('077');--MYVAR;MYVAR", 76, eval("var MYVAR=new String('077');--MYVAR;MYVAR") ); - array[item++] = new TestCase( SECTION, "var MYVAR=new String('');--MYVAR;MYVAR", -1, eval("var MYVAR=new String('');--MYVAR;MYVAR") ); - - return ( array ); -} diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.4.6.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.4.6.js deleted file mode 100644 index 31d9551..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.4.6.js +++ /dev/null @@ -1,299 +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: 11.4.6.js - ECMA Section: 11.4.6 Unary + Operator - Description: convert operand to Number type - Author: christine@netscape.com - Date: 7 july 1997 -*/ - - var SECTION = "11.4.6"; - var VERSION = "ECMA_1"; - startTest(); - var testcases = getTestCases(); - var BUGNUMBER="77391"; - - writeHeaderToLog( SECTION + " Unary + operator"); - 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(); - var item = 0; - array[item++] = new TestCase( SECTION, "+('')", 0, +("") ); - array[item++] = new TestCase( SECTION, "+(' ')", 0, +(" ") ); - array[item++] = new TestCase( SECTION, "+(\\t)", 0, +("\t") ); - array[item++] = new TestCase( SECTION, "+(\\n)", 0, +("\n") ); - array[item++] = new TestCase( SECTION, "+(\\r)", 0, +("\r") ); - array[item++] = new TestCase( SECTION, "+(\\f)", 0, +("\f") ); - - array[item++] = new TestCase( SECTION, "+(String.fromCharCode(0x0009)", 0, +(String.fromCharCode(0x0009)) ); - array[item++] = new TestCase( SECTION, "+(String.fromCharCode(0x0020)", 0, +(String.fromCharCode(0x0020)) ); - array[item++] = new TestCase( SECTION, "+(String.fromCharCode(0x000C)", 0, +(String.fromCharCode(0x000C)) ); - array[item++] = new TestCase( SECTION, "+(String.fromCharCode(0x000B)", 0, +(String.fromCharCode(0x000B)) ); - array[item++] = new TestCase( SECTION, "+(String.fromCharCode(0x000D)", 0, +(String.fromCharCode(0x000D)) ); - array[item++] = new TestCase( SECTION, "+(String.fromCharCode(0x000A)", 0, +(String.fromCharCode(0x000A)) ); - - // a StringNumericLiteral may be preceeded or followed by whitespace and/or - // line terminators - - array[item++] = new TestCase( SECTION, "+( ' ' + 999 )", 999, +( ' '+999) ); - array[item++] = new TestCase( SECTION, "+( '\\n' + 999 )", 999, +( '\n' +999) ); - array[item++] = new TestCase( SECTION, "+( '\\r' + 999 )", 999, +( '\r' +999) ); - array[item++] = new TestCase( SECTION, "+( '\\t' + 999 )", 999, +( '\t' +999) ); - array[item++] = new TestCase( SECTION, "+( '\\f' + 999 )", 999, +( '\f' +999) ); - - array[item++] = new TestCase( SECTION, "+( 999 + ' ' )", 999, +( 999+' ') ); - array[item++] = new TestCase( SECTION, "+( 999 + '\\n' )", 999, +( 999+'\n' ) ); - array[item++] = new TestCase( SECTION, "+( 999 + '\\r' )", 999, +( 999+'\r' ) ); - array[item++] = new TestCase( SECTION, "+( 999 + '\\t' )", 999, +( 999+'\t' ) ); - array[item++] = new TestCase( SECTION, "+( 999 + '\\f' )", 999, +( 999+'\f' ) ); - - array[item++] = new TestCase( SECTION, "+( '\\n' + 999 + '\\n' )", 999, +( '\n' +999+'\n' ) ); - array[item++] = new TestCase( SECTION, "+( '\\r' + 999 + '\\r' )", 999, +( '\r' +999+'\r' ) ); - array[item++] = new TestCase( SECTION, "+( '\\t' + 999 + '\\t' )", 999, +( '\t' +999+'\t' ) ); - array[item++] = new TestCase( SECTION, "+( '\\f' + 999 + '\\f' )", 999, +( '\f' +999+'\f' ) ); - - array[item++] = new TestCase( SECTION, "+( ' ' + '999' )", 999, +( ' '+'999') ); - array[item++] = new TestCase( SECTION, "+( '\\n' + '999' )", 999, +( '\n' +'999') ); - array[item++] = new TestCase( SECTION, "+( '\\r' + '999' )", 999, +( '\r' +'999') ); - array[item++] = new TestCase( SECTION, "+( '\\t' + '999' )", 999, +( '\t' +'999') ); - array[item++] = new TestCase( SECTION, "+( '\\f' + '999' )", 999, +( '\f' +'999') ); - - array[item++] = new TestCase( SECTION, "+( '999' + ' ' )", 999, +( '999'+' ') ); - array[item++] = new TestCase( SECTION, "+( '999' + '\\n' )", 999, +( '999'+'\n' ) ); - array[item++] = new TestCase( SECTION, "+( '999' + '\\r' )", 999, +( '999'+'\r' ) ); - array[item++] = new TestCase( SECTION, "+( '999' + '\\t' )", 999, +( '999'+'\t' ) ); - array[item++] = new TestCase( SECTION, "+( '999' + '\\f' )", 999, +( '999'+'\f' ) ); - - array[item++] = new TestCase( SECTION, "+( '\\n' + '999' + '\\n' )", 999, +( '\n' +'999'+'\n' ) ); - array[item++] = new TestCase( SECTION, "+( '\\r' + '999' + '\\r' )", 999, +( '\r' +'999'+'\r' ) ); - array[item++] = new TestCase( SECTION, "+( '\\t' + '999' + '\\t' )", 999, +( '\t' +'999'+'\t' ) ); - array[item++] = new TestCase( SECTION, "+( '\\f' + '999' + '\\f' )", 999, +( '\f' +'999'+'\f' ) ); - - array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x0009) + '99' )", 99, +( String.fromCharCode(0x0009) + '99' ) ); - array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x0020) + '99' )", 99, +( String.fromCharCode(0x0020) + '99' ) ); - array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x000C) + '99' )", 99, +( String.fromCharCode(0x000C) + '99' ) ); - array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x000B) + '99' )", 99, +( String.fromCharCode(0x000B) + '99' ) ); - array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x000D) + '99' )", 99, +( String.fromCharCode(0x000D) + '99' ) ); - array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x000A) + '99' )", 99, +( String.fromCharCode(0x000A) + '99' ) ); - - array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x0009)", 99, +( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x0009)) ); - array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x0020) + '99' + String.fromCharCode(0x0020)", 99, +( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x0020)) ); - array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x000C) + '99' + String.fromCharCode(0x000C)", 99, +( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x000C)) ); - array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x000D) + '99' + String.fromCharCode(0x000D)", 99, +( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x000D)) ); - array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x000B) + '99' + String.fromCharCode(0x000B)", 99, +( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x000B)) ); - array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x000A) + '99' + String.fromCharCode(0x000A)", 99, +( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x000A)) ); - - array[item++] = new TestCase( SECTION, "+( '99' + String.fromCharCode(0x0009)", 99, +( '99' + String.fromCharCode(0x0009)) ); - array[item++] = new TestCase( SECTION, "+( '99' + String.fromCharCode(0x0020)", 99, +( '99' + String.fromCharCode(0x0020)) ); - array[item++] = new TestCase( SECTION, "+( '99' + String.fromCharCode(0x000C)", 99, +( '99' + String.fromCharCode(0x000C)) ); - array[item++] = new TestCase( SECTION, "+( '99' + String.fromCharCode(0x000D)", 99, +( '99' + String.fromCharCode(0x000D)) ); - array[item++] = new TestCase( SECTION, "+( '99' + String.fromCharCode(0x000B)", 99, +( '99' + String.fromCharCode(0x000B)) ); - array[item++] = new TestCase( SECTION, "+( '99' + String.fromCharCode(0x000A)", 99, +( '99' + String.fromCharCode(0x000A)) ); - - array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x0009) + 99 )", 99, +( String.fromCharCode(0x0009) + 99 ) ); - array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x0020) + 99 )", 99, +( String.fromCharCode(0x0020) + 99 ) ); - array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x000C) + 99 )", 99, +( String.fromCharCode(0x000C) + 99 ) ); - array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x000B) + 99 )", 99, +( String.fromCharCode(0x000B) + 99 ) ); - array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x000D) + 99 )", 99, +( String.fromCharCode(0x000D) + 99 ) ); - array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x000A) + 99 )", 99, +( String.fromCharCode(0x000A) + 99 ) ); - - array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x0009)", 99, +( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x0009)) ); - array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x0020) + 99 + String.fromCharCode(0x0020)", 99, +( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x0020)) ); - array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x000C) + 99 + String.fromCharCode(0x000C)", 99, +( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x000C)) ); - array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x000D) + 99 + String.fromCharCode(0x000D)", 99, +( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x000D)) ); - array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x000B) + 99 + String.fromCharCode(0x000B)", 99, +( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x000B)) ); - array[item++] = new TestCase( SECTION, "+( String.fromCharCode(0x000A) + 99 + String.fromCharCode(0x000A)", 99, +( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x000A)) ); - - array[item++] = new TestCase( SECTION, "+( 99 + String.fromCharCode(0x0009)", 99, +( 99 + String.fromCharCode(0x0009)) ); - array[item++] = new TestCase( SECTION, "+( 99 + String.fromCharCode(0x0020)", 99, +( 99 + String.fromCharCode(0x0020)) ); - array[item++] = new TestCase( SECTION, "+( 99 + String.fromCharCode(0x000C)", 99, +( 99 + String.fromCharCode(0x000C)) ); - array[item++] = new TestCase( SECTION, "+( 99 + String.fromCharCode(0x000D)", 99, +( 99 + String.fromCharCode(0x000D)) ); - array[item++] = new TestCase( SECTION, "+( 99 + String.fromCharCode(0x000B)", 99, +( 99 + String.fromCharCode(0x000B)) ); - array[item++] = new TestCase( SECTION, "+( 99 + String.fromCharCode(0x000A)", 99, +( 99 + String.fromCharCode(0x000A)) ); - - - // StrNumericLiteral:::StrDecimalLiteral:::Infinity - - array[item++] = new TestCase( SECTION, "+('Infinity')", Math.pow(10,10000), +("Infinity") ); - array[item++] = new TestCase( SECTION, "+('-Infinity')", -Math.pow(10,10000), +("-Infinity") ); - array[item++] = new TestCase( SECTION, "+('+Infinity')", Math.pow(10,10000), +("+Infinity") ); - - // StrNumericLiteral::: StrDecimalLiteral ::: DecimalDigits . DecimalDigits opt ExponentPart opt - - array[item++] = new TestCase( SECTION, "+('0')", 0, +("0") ); - array[item++] = new TestCase( SECTION, "+('-0')", -0, +("-0") ); - array[item++] = new TestCase( SECTION, "+('+0')", 0, +("+0") ); - - array[item++] = new TestCase( SECTION, "+('1')", 1, +("1") ); - array[item++] = new TestCase( SECTION, "+('-1')", -1, +("-1") ); - array[item++] = new TestCase( SECTION, "+('+1')", 1, +("+1") ); - - array[item++] = new TestCase( SECTION, "+('2')", 2, +("2") ); - array[item++] = new TestCase( SECTION, "+('-2')", -2, +("-2") ); - array[item++] = new TestCase( SECTION, "+('+2')", 2, +("+2") ); - - array[item++] = new TestCase( SECTION, "+('3')", 3, +("3") ); - array[item++] = new TestCase( SECTION, "+('-3')", -3, +("-3") ); - array[item++] = new TestCase( SECTION, "+('+3')", 3, +("+3") ); - - array[item++] = new TestCase( SECTION, "+('4')", 4, +("4") ); - array[item++] = new TestCase( SECTION, "+('-4')", -4, +("-4") ); - array[item++] = new TestCase( SECTION, "+('+4')", 4, +("+4") ); - - array[item++] = new TestCase( SECTION, "+('5')", 5, +("5") ); - array[item++] = new TestCase( SECTION, "+('-5')", -5, +("-5") ); - array[item++] = new TestCase( SECTION, "+('+5')", 5, +("+5") ); - - array[item++] = new TestCase( SECTION, "+('6')", 6, +("6") ); - array[item++] = new TestCase( SECTION, "+('-6')", -6, +("-6") ); - array[item++] = new TestCase( SECTION, "+('+6')", 6, +("+6") ); - - array[item++] = new TestCase( SECTION, "+('7')", 7, +("7") ); - array[item++] = new TestCase( SECTION, "+('-7')", -7, +("-7") ); - array[item++] = new TestCase( SECTION, "+('+7')", 7, +("+7") ); - - array[item++] = new TestCase( SECTION, "+('8')", 8, +("8") ); - array[item++] = new TestCase( SECTION, "+('-8')", -8, +("-8") ); - array[item++] = new TestCase( SECTION, "+('+8')", 8, +("+8") ); - - array[item++] = new TestCase( SECTION, "+('9')", 9, +("9") ); - array[item++] = new TestCase( SECTION, "+('-9')", -9, +("-9") ); - array[item++] = new TestCase( SECTION, "+('+9')", 9, +("+9") ); - - array[item++] = new TestCase( SECTION, "+('3.14159')", 3.14159, +("3.14159") ); - array[item++] = new TestCase( SECTION, "+('-3.14159')", -3.14159, +("-3.14159") ); - array[item++] = new TestCase( SECTION, "+('+3.14159')", 3.14159, +("+3.14159") ); - - array[item++] = new TestCase( SECTION, "+('3.')", 3, +("3.") ); - array[item++] = new TestCase( SECTION, "+('-3.')", -3, +("-3.") ); - array[item++] = new TestCase( SECTION, "+('+3.')", 3, +("+3.") ); - - array[item++] = new TestCase( SECTION, "+('3.e1')", 30, +("3.e1") ); - array[item++] = new TestCase( SECTION, "+('-3.e1')", -30, +("-3.e1") ); - array[item++] = new TestCase( SECTION, "+('+3.e1')", 30, +("+3.e1") ); - - array[item++] = new TestCase( SECTION, "+('3.e+1')", 30, +("3.e+1") ); - array[item++] = new TestCase( SECTION, "+('-3.e+1')", -30, +("-3.e+1") ); - array[item++] = new TestCase( SECTION, "+('+3.e+1')", 30, +("+3.e+1") ); - - array[item++] = new TestCase( SECTION, "+('3.e-1')", .30, +("3.e-1") ); - array[item++] = new TestCase( SECTION, "+('-3.e-1')", -.30, +("-3.e-1") ); - array[item++] = new TestCase( SECTION, "+('+3.e-1')", .30, +("+3.e-1") ); - - // StrDecimalLiteral::: .DecimalDigits ExponentPart opt - - array[item++] = new TestCase( SECTION, "+('.00001')", 0.00001, +(".00001") ); - array[item++] = new TestCase( SECTION, "+('+.00001')", 0.00001, +("+.00001") ); - array[item++] = new TestCase( SECTION, "+('-0.0001')", -0.00001, +("-.00001") ); - - array[item++] = new TestCase( SECTION, "+('.01e2')", 1, +(".01e2") ); - array[item++] = new TestCase( SECTION, "+('+.01e2')", 1, +("+.01e2") ); - array[item++] = new TestCase( SECTION, "+('-.01e2')", -1, +("-.01e2") ); - - array[item++] = new TestCase( SECTION, "+('.01e+2')", 1, +(".01e+2") ); - array[item++] = new TestCase( SECTION, "+('+.01e+2')", 1, +("+.01e+2") ); - array[item++] = new TestCase( SECTION, "+('-.01e+2')", -1, +("-.01e+2") ); - - array[item++] = new TestCase( SECTION, "+('.01e-2')", 0.0001, +(".01e-2") ); - array[item++] = new TestCase( SECTION, "+('+.01e-2')", 0.0001, +("+.01e-2") ); - array[item++] = new TestCase( SECTION, "+('-.01e-2')", -0.0001, +("-.01e-2") ); - - // StrDecimalLiteral::: DecimalDigits ExponentPart opt - - array[item++] = new TestCase( SECTION, "+('1234e5')", 123400000, +("1234e5") ); - array[item++] = new TestCase( SECTION, "+('+1234e5')", 123400000, +("+1234e5") ); - array[item++] = new TestCase( SECTION, "+('-1234e5')", -123400000, +("-1234e5") ); - - array[item++] = new TestCase( SECTION, "+('1234e+5')", 123400000, +("1234e+5") ); - array[item++] = new TestCase( SECTION, "+('+1234e+5')", 123400000, +("+1234e+5") ); - array[item++] = new TestCase( SECTION, "+('-1234e+5')", -123400000, +("-1234e+5") ); - - array[item++] = new TestCase( SECTION, "+('1234e-5')", 0.01234, +("1234e-5") ); - array[item++] = new TestCase( SECTION, "+('+1234e-5')", 0.01234, +("+1234e-5") ); - array[item++] = new TestCase( SECTION, "+('-1234e-5')", -0.01234, +("-1234e-5") ); - - // StrNumericLiteral::: HexIntegerLiteral - - array[item++] = new TestCase( SECTION, "+('0x0')", 0, +("0x0")); - array[item++] = new TestCase( SECTION, "+('0x1')", 1, +("0x1")); - array[item++] = new TestCase( SECTION, "+('0x2')", 2, +("0x2")); - array[item++] = new TestCase( SECTION, "+('0x3')", 3, +("0x3")); - array[item++] = new TestCase( SECTION, "+('0x4')", 4, +("0x4")); - array[item++] = new TestCase( SECTION, "+('0x5')", 5, +("0x5")); - array[item++] = new TestCase( SECTION, "+('0x6')", 6, +("0x6")); - array[item++] = new TestCase( SECTION, "+('0x7')", 7, +("0x7")); - array[item++] = new TestCase( SECTION, "+('0x8')", 8, +("0x8")); - array[item++] = new TestCase( SECTION, "+('0x9')", 9, +("0x9")); - array[item++] = new TestCase( SECTION, "+('0xa')", 10, +("0xa")); - array[item++] = new TestCase( SECTION, "+('0xb')", 11, +("0xb")); - array[item++] = new TestCase( SECTION, "+('0xc')", 12, +("0xc")); - array[item++] = new TestCase( SECTION, "+('0xd')", 13, +("0xd")); - array[item++] = new TestCase( SECTION, "+('0xe')", 14, +("0xe")); - array[item++] = new TestCase( SECTION, "+('0xf')", 15, +("0xf")); - array[item++] = new TestCase( SECTION, "+('0xA')", 10, +("0xA")); - array[item++] = new TestCase( SECTION, "+('0xB')", 11, +("0xB")); - array[item++] = new TestCase( SECTION, "+('0xC')", 12, +("0xC")); - array[item++] = new TestCase( SECTION, "+('0xD')", 13, +("0xD")); - array[item++] = new TestCase( SECTION, "+('0xE')", 14, +("0xE")); - array[item++] = new TestCase( SECTION, "+('0xF')", 15, +("0xF")); - - array[item++] = new TestCase( SECTION, "+('0X0')", 0, +("0X0")); - array[item++] = new TestCase( SECTION, "+('0X1')", 1, +("0X1")); - array[item++] = new TestCase( SECTION, "+('0X2')", 2, +("0X2")); - array[item++] = new TestCase( SECTION, "+('0X3')", 3, +("0X3")); - array[item++] = new TestCase( SECTION, "+('0X4')", 4, +("0X4")); - array[item++] = new TestCase( SECTION, "+('0X5')", 5, +("0X5")); - array[item++] = new TestCase( SECTION, "+('0X6')", 6, +("0X6")); - array[item++] = new TestCase( SECTION, "+('0X7')", 7, +("0X7")); - array[item++] = new TestCase( SECTION, "+('0X8')", 8, +("0X8")); - array[item++] = new TestCase( SECTION, "+('0X9')", 9, +("0X9")); - array[item++] = new TestCase( SECTION, "+('0Xa')", 10, +("0Xa")); - array[item++] = new TestCase( SECTION, "+('0Xb')", 11, +("0Xb")); - array[item++] = new TestCase( SECTION, "+('0Xc')", 12, +("0Xc")); - array[item++] = new TestCase( SECTION, "+('0Xd')", 13, +("0Xd")); - array[item++] = new TestCase( SECTION, "+('0Xe')", 14, +("0Xe")); - array[item++] = new TestCase( SECTION, "+('0Xf')", 15, +("0Xf")); - array[item++] = new TestCase( SECTION, "+('0XA')", 10, +("0XA")); - array[item++] = new TestCase( SECTION, "+('0XB')", 11, +("0XB")); - array[item++] = new TestCase( SECTION, "+('0XC')", 12, +("0XC")); - array[item++] = new TestCase( SECTION, "+('0XD')", 13, +("0XD")); - array[item++] = new TestCase( SECTION, "+('0XE')", 14, +("0XE")); - array[item++] = new TestCase( SECTION, "+('0XF')", 15, +("0XF")); - - return array; - -}
\ No newline at end of file diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.4.8.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.4.8.js deleted file mode 100644 index 491167f..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.4.8.js +++ /dev/null @@ -1,215 +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: 11.4.8.js - ECMA Section: 11.4.8 Bitwise NOT Operator - Description: flip bits up to 32 bits - no special cases - Author: christine@netscape.com - Date: 7 july 1997 - - Data File Fields: - VALUE value passed as an argument to the ~ operator - E_RESULT expected return value of ~ VALUE; - - Static variables: - none - -*/ - - var SECTION = "11.4.8"; - var VERSION = "ECMA_1"; - startTest(); - var testcases = getTestCases(); - - writeHeaderToLog( SECTION + " Bitwise Not operator"); - 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(); - var item = 0; - - for ( var i = 0; i < 35; i++ ) { - var p = Math.pow(2,i); - - array[item++] = new TestCase( SECTION, "~"+p, Not(p), ~p ); - - } - for ( i = 0; i < 35; i++ ) { - var p = -Math.pow(2,i); - - array[item++] = new TestCase( SECTION, "~"+p, Not(p), ~p ); - - } - - return ( array ); -} -function ToInteger( n ) { - n = Number( n ); - var sign = ( n < 0 ) ? -1 : 1; - - if ( n != n ) { - return 0; - } - if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY ) { - return n; - } - return ( sign * Math.floor(Math.abs(n)) ); -} -function ToInt32( 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) )) % Math.pow(2,32); - n = ( n >= Math.pow(2,31) ) ? n - Math.pow(2,32) : n; - - return ( n ); -} -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 ); -} -function ToUint16( 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) ) ) % Math.pow(2,16); - - if (n <0) { - n += Math.pow(2,16); - } - - return ( n ); -} -function Mask( b, n ) { - b = ToUint32BitString( b ); - b = b.substring( b.length - n ); - b = ToUint32Decimal( b ); - return ( b ); -} -function ToUint32BitString( n ) { - var b = ""; - for ( p = 31; p >=0; p-- ) { - if ( n >= Math.pow(2,p) ) { - b += "1"; - n -= Math.pow(2,p); - } else { - b += "0"; - } - } - return b; -} -function ToInt32BitString( n ) { - var b = ""; - var sign = ( n < 0 ) ? -1 : 1; - - b += ( sign == 1 ) ? "0" : "1"; - - for ( p = 30; p >=0; p-- ) { - if ( (sign == 1 ) ? sign * n >= Math.pow(2,p) : sign * n > Math.pow(2,p) ) { - b += ( sign == 1 ) ? "1" : "0"; - n -= sign * Math.pow( 2, p ); - } else { - b += ( sign == 1 ) ? "0" : "1"; - } - } - - return b; -} -function ToInt32Decimal( bin ) { - var r = 0; - var sign; - - if ( Number(bin.charAt(0)) == 0 ) { - sign = 1; - r = 0; - } else { - sign = -1; - r = -(Math.pow(2,31)); - } - - for ( var j = 0; j < 31; j++ ) { - r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); - } - - return r; -} -function ToUint32Decimal( bin ) { - var r = 0; - - for ( l = bin.length; l < 32; l++ ) { - bin = "0" + bin; - } - - for ( j = 0; j < 31; j++ ) { - r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); - } - - return r; -} -function Not( n ) { - n = ToInt32(n); - n = ToInt32BitString(n); - - r = "" - - for( var l = 0; l < n.length; l++ ) { - r += ( n.charAt(l) == "0" ) ? "1" : "0"; - } - - n = ToInt32Decimal(r); - - return n; -}
\ No newline at end of file diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.4.9.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.4.9.js deleted file mode 100644 index 90ef06d..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.4.9.js +++ /dev/null @@ -1,90 +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: 11.4.9.js - ECMA Section: 11.4.9 Logical NOT Operator (!) - Description: if the ToBoolean( VALUE ) result is true, return - true. else return false. - Author: christine@netscape.com - Date: 7 july 1997 - - Static variables: - none -*/ - var SECTION = "11.4.9"; - var VERSION = "ECMA_1"; - startTest(); - var TITLE = "Logical NOT operator (!)"; - - writeHeaderToLog( SECTION + " "+ TITLE); - -// version("130") - - var testcases = new Array(); - - testcases[tc++] = new TestCase( SECTION, "!(null)", true, !(null) ); - testcases[tc++] = new TestCase( SECTION, "!(var x)", true, !(eval("var x")) ); - testcases[tc++] = new TestCase( SECTION, "!(void 0)", true, !(void 0) ); - - testcases[tc++] = new TestCase( SECTION, "!(false)", true, !(false) ); - testcases[tc++] = new TestCase( SECTION, "!(true)", false, !(true) ); - testcases[tc++] = new TestCase( SECTION, "!()", true, !(eval()) ); - testcases[tc++] = new TestCase( SECTION, "!(0)", true, !(0) ); - testcases[tc++] = new TestCase( SECTION, "!(-0)", true, !(-0) ); - testcases[tc++] = new TestCase( SECTION, "!(NaN)", true, !(Number.NaN) ); - testcases[tc++] = new TestCase( SECTION, "!(Infinity)", false, !(Number.POSITIVE_INFINITY) ); - testcases[tc++] = new TestCase( SECTION, "!(-Infinity)", false, !(Number.NEGATIVE_INFINITY) ); - testcases[tc++] = new TestCase( SECTION, "!(Math.PI)", false, !(Math.PI) ); - testcases[tc++] = new TestCase( SECTION, "!(1)", false, !(1) ); - testcases[tc++] = new TestCase( SECTION, "!(-1)", false, !(-1) ); - testcases[tc++] = new TestCase( SECTION, "!('')", true, !("") ); - testcases[tc++] = new TestCase( SECTION, "!('\t')", false, !("\t") ); - testcases[tc++] = new TestCase( SECTION, "!('0')", false, !("0") ); - testcases[tc++] = new TestCase( SECTION, "!('string')", false, !("string") ); - testcases[tc++] = new TestCase( SECTION, "!(new String(''))", false, !(new String("")) ); - testcases[tc++] = new TestCase( SECTION, "!(new String('string'))", false, !(new String("string")) ); - testcases[tc++] = new TestCase( SECTION, "!(new String())", false, !(new String()) ); - testcases[tc++] = new TestCase( SECTION, "!(new Boolean(true))", false, !(new Boolean(true)) ); - testcases[tc++] = new TestCase( SECTION, "!(new Boolean(false))", false, !(new Boolean(false)) ); - testcases[tc++] = new TestCase( SECTION, "!(new Array())", false, !(new Array()) ); - testcases[tc++] = new TestCase( SECTION, "!(new Array(1,2,3)", false, !(new Array(1,2,3)) ); - testcases[tc++] = new TestCase( SECTION, "!(new Number())", false, !(new Number()) ); - testcases[tc++] = new TestCase( SECTION, "!(new Number(0))", false, !(new Number(0)) ); - testcases[tc++] = new TestCase( SECTION, "!(new Number(NaN))", false, !(new Number(Number.NaN)) ); - testcases[tc++] = new TestCase( SECTION, "!(new Number(Infinity))", false, !(new Number(Number.POSITIVE_INFINITY)) ); - - 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(); - - // all tests must return a boolean value - return ( testcases ); -} diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.5.1.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.5.1.js deleted file mode 100644 index 67c0a8a..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.5.1.js +++ /dev/null @@ -1,115 +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: 11.5.1.js - ECMA Section: 11.5.1 Applying the * operator - Description: - - 11.5.1 Applying the * operator - - The * operator performs multiplication, producing the product of its - operands. Multiplication is commutative. Multiplication is not always - associative in ECMAScript, because of finite precision. - - The result of a floating-point multiplication is governed by the rules - of IEEE 754 double-precision arithmetic: - - If either operand is NaN, the result is NaN. - The sign of the result is positive if both operands have the same sign, - negative if the operands have different signs. - Multiplication of an infinity by a zero results in NaN. - Multiplication of an infinity by an infinity results in an infinity. - The sign is determined by the rule already stated above. - Multiplication of an infinity by a finite non-zero value results in a - signed infinity. The sign is determined by the rule already stated above. - In the remaining cases, where neither an infinity or NaN is involved, the - product is computed and rounded to the nearest representable value using IEEE - 754 round-to-nearest mode. If the magnitude is too large to represent, - the result is then an infinity of appropriate sign. If the magnitude is - oo small to represent, the result is then a zero - of appropriate sign. The ECMAScript language requires support of gradual - underflow as defined by IEEE 754. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.5.1"; - var VERSION = "ECMA_1"; - startTest(); - var testcases = getTestCases(); - - writeHeaderToLog( SECTION + " Applying the * operator"); - 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(); - var item = 0; - - array[item++] = new TestCase( SECTION, "Number.NaN * Number.NaN", Number.NaN, Number.NaN * Number.NaN ); - array[item++] = new TestCase( SECTION, "Number.NaN * 1", Number.NaN, Number.NaN * 1 ); - array[item++] = new TestCase( SECTION, "1 * Number.NaN", Number.NaN, 1 * Number.NaN ); - - array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY * 0", Number.NaN, Number.POSITIVE_INFINITY * 0 ); - array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY * 0", Number.NaN, Number.NEGATIVE_INFINITY * 0 ); - array[item++] = new TestCase( SECTION, "0 * Number.POSITIVE_INFINITY", Number.NaN, 0 * Number.POSITIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "0 * Number.NEGATIVE_INFINITY", Number.NaN, 0 * Number.NEGATIVE_INFINITY ); - - array[item++] = new TestCase( SECTION, "-0 * Number.POSITIVE_INFINITY", Number.NaN, -0 * Number.POSITIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "-0 * Number.NEGATIVE_INFINITY", Number.NaN, -0 * Number.NEGATIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY * -0", Number.NaN, Number.POSITIVE_INFINITY * -0 ); - array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY * -0", Number.NaN, Number.NEGATIVE_INFINITY * -0 ); - - array[item++] = new TestCase( SECTION, "0 * -0", -0, 0 * -0 ); - array[item++] = new TestCase( SECTION, "-0 * 0", -0, -0 * 0 ); - array[item++] = new TestCase( SECTION, "-0 * -0", 0, -0 * -0 ); - array[item++] = new TestCase( SECTION, "0 * 0", 0, 0 * 0 ); - - array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY * Number.NEGATIVE_INFINITY", Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY * Number.NEGATIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY * Number.NEGATIVE_INFINITY", Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY * Number.NEGATIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY * Number.POSITIVE_INFINITY", Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY * Number.POSITIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY * Number.POSITIVE_INFINITY", Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY * Number.POSITIVE_INFINITY ); - - array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY * 1 ", Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY * 1 ); - array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY * -1 ", Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY * -1 ); - array[item++] = new TestCase( SECTION, "1 * Number.NEGATIVE_INFINITY", Number.NEGATIVE_INFINITY, 1 * Number.NEGATIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "-1 * Number.NEGATIVE_INFINITY", Number.POSITIVE_INFINITY, -1 * Number.NEGATIVE_INFINITY ); - - array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY * 1 ", Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY * 1 ); - array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY * -1 ", Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY * -1 ); - array[item++] = new TestCase( SECTION, "1 * Number.POSITIVE_INFINITY", Number.POSITIVE_INFINITY, 1 * Number.POSITIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "-1 * Number.POSITIVE_INFINITY", Number.NEGATIVE_INFINITY, -1 * Number.POSITIVE_INFINITY ); - - return ( array ); -} diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.5.2.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.5.2.js deleted file mode 100644 index c681a35..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.5.2.js +++ /dev/null @@ -1,154 +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: 11.5.2.js - ECMA Section: 11.5.2 Applying the / operator - Description: - - The / operator performs division, producing the quotient of its operands. - The left operand is the dividend and the right operand is the divisor. - ECMAScript does not perform integer division. The operands and result of all - division operations are double-precision floating-point numbers. - The result of division is determined by the specification of IEEE 754 arithmetic: - - If either operand is NaN, the result is NaN. - The sign of the result is positive if both operands have the same sign, negative if the operands have different - signs. - Division of an infinity by an infinity results in NaN. - Division of an infinity by a zero results in an infinity. The sign is determined by the rule already stated above. - Division of an infinity by a non-zero finite value results in a signed infinity. The sign is determined by the rule - already stated above. - Division of a finite value by an infinity results in zero. The sign is determined by the rule already stated above. - Division of a zero by a zero results in NaN; division of zero by any other finite value results in zero, with the sign - determined by the rule already stated above. - Division of a non-zero finite value by a zero results in a signed infinity. The sign is determined by the rule - already stated above. - In the remaining cases, where neither an infinity, nor a zero, nor NaN is involved, the quotient is computed and - rounded to the nearest representable value using IEEE 754 round-to-nearest mode. If the magnitude is too - large to represent, we say the operation overflows; the result is then an infinity of appropriate sign. If the - magnitude is too small to represent, we say the operation underflows and the result is a zero of the appropriate - sign. The ECMAScript language requires support of gradual underflow as defined by IEEE 754. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.5.2"; - var VERSION = "ECMA_1"; - startTest(); - var testcases = getTestCases(); - var BUGNUMBER="111202"; - - writeHeaderToLog( SECTION + " Applying the / operator"); - 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(); - var item = 0; - - // if either operand is NaN, the result is NaN. - - array[item++] = new TestCase( SECTION, "Number.NaN / Number.NaN", Number.NaN, Number.NaN / Number.NaN ); - array[item++] = new TestCase( SECTION, "Number.NaN / 1", Number.NaN, Number.NaN / 1 ); - array[item++] = new TestCase( SECTION, "1 / Number.NaN", Number.NaN, 1 / Number.NaN ); - - array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY / Number.NaN", Number.NaN, Number.POSITIVE_INFINITY / Number.NaN ); - array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY / Number.NaN", Number.NaN, Number.NEGATIVE_INFINITY / Number.NaN ); - - // Division of an infinity by an infinity results in NaN. - - array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY / Number.NEGATIVE_INFINITY", Number.NaN, Number.NEGATIVE_INFINITY / Number.NEGATIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY / Number.NEGATIVE_INFINITY", Number.NaN, Number.POSITIVE_INFINITY / Number.NEGATIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY / Number.POSITIVE_INFINITY", Number.NaN, Number.NEGATIVE_INFINITY / Number.POSITIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY / Number.POSITIVE_INFINITY", Number.NaN, Number.POSITIVE_INFINITY / Number.POSITIVE_INFINITY ); - - // Division of an infinity by a zero results in an infinity. - - array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY / 0", Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY / 0 ); - array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY / 0", Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY / 0 ); - array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY / -0", Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY / -0 ); - array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY / -0", Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY / -0 ); - - // Division of an infinity by a non-zero finite value results in a signed infinity. - - array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY / 1 ", Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY / 1 ); - array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY / -1 ", Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY / -1 ); - array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY / 1 ", Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY / 1 ); - array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY / -1 ", Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY / -1 ); - - array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY / Number.MAX_VALUE ", Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY / Number.MAX_VALUE ); - array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY / -Number.MAX_VALUE ", Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY / -Number.MAX_VALUE ); - array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY / Number.MAX_VALUE ", Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY / Number.MAX_VALUE ); - array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY / -Number.MAX_VALUE ", Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY / -Number.MAX_VALUE ); - - // Division of a finite value by an infinity results in zero. - - array[item++] = new TestCase( SECTION, "1 / Number.NEGATIVE_INFINITY", -0, 1 / Number.NEGATIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "1 / Number.POSITIVE_INFINITY", 0, 1 / Number.POSITIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "-1 / Number.POSITIVE_INFINITY", -0, -1 / Number.POSITIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "-1 / Number.NEGATIVE_INFINITY", 0, -1 / Number.NEGATIVE_INFINITY ); - - array[item++] = new TestCase( SECTION, "Number.MAX_VALUE / Number.NEGATIVE_INFINITY", -0, Number.MAX_VALUE / Number.NEGATIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "Number.MAX_VALUE / Number.POSITIVE_INFINITY", 0, Number.MAX_VALUE / Number.POSITIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "-Number.MAX_VALUE / Number.POSITIVE_INFINITY", -0, -Number.MAX_VALUE / Number.POSITIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "-Number.MAX_VALUE / Number.NEGATIVE_INFINITY", 0, -Number.MAX_VALUE / Number.NEGATIVE_INFINITY ); - - // Division of a zero by a zero results in NaN - - array[item++] = new TestCase( SECTION, "0 / -0", Number.NaN, 0 / -0 ); - array[item++] = new TestCase( SECTION, "-0 / 0", Number.NaN, -0 / 0 ); - array[item++] = new TestCase( SECTION, "-0 / -0", Number.NaN, -0 / -0 ); - array[item++] = new TestCase( SECTION, "0 / 0", Number.NaN, 0 / 0 ); - - // division of zero by any other finite value results in zero - - array[item++] = new TestCase( SECTION, "0 / 1", 0, 0 / 1 ); - array[item++] = new TestCase( SECTION, "0 / -1", -0, 0 / -1 ); - array[item++] = new TestCase( SECTION, "-0 / 1", -0, -0 / 1 ); - array[item++] = new TestCase( SECTION, "-0 / -1", 0, -0 / -1 ); - - // Division of a non-zero finite value by a zero results in a signed infinity. - - array[item++] = new TestCase( SECTION, "1 / 0", Number.POSITIVE_INFINITY, 1/0 ); - array[item++] = new TestCase( SECTION, "1 / -0", Number.NEGATIVE_INFINITY, 1/-0 ); - array[item++] = new TestCase( SECTION, "-1 / 0", Number.NEGATIVE_INFINITY, -1/0 ); - array[item++] = new TestCase( SECTION, "-1 / -0", Number.POSITIVE_INFINITY, -1/-0 ); - - array[item++] = new TestCase( SECTION, "0 / Number.POSITIVE_INFINITY", 0, 0 / Number.POSITIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "0 / Number.NEGATIVE_INFINITY", -0, 0 / Number.NEGATIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "-0 / Number.POSITIVE_INFINITY", -0, -0 / Number.POSITIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "-0 / Number.NEGATIVE_INFINITY", 0, -0 / Number.NEGATIVE_INFINITY ); - - return ( array ); -} diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.5.3.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.5.3.js deleted file mode 100644 index 8b9722c..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.5.3.js +++ /dev/null @@ -1,160 +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: 11.5.3.js - ECMA Section: 11.5.3 Applying the % operator - Description: - - The binary % operator is said to yield the remainder of its operands from - an implied division; the left operand is the dividend and the right operand - is the divisor. In C and C++, the remainder operator accepts only integral - operands, but in ECMAScript, it also accepts floating-point operands. - - The result of a floating-point remainder operation as computed by the % - operator is not the same as the "remainder" operation defined by IEEE 754. - The IEEE 754 "remainder" operation computes the remainder from a rounding - division, not a truncating division, and so its behavior is not analogous - to that of the usual integer remainder operator. Instead the ECMAScript - language defines % on floating-point operations to behave in a manner - analogous to that of the Java integer remainder operator; this may be - compared with the C library function fmod. - - The result of a ECMAScript floating-point remainder operation is determined by the rules of IEEE arithmetic: - - If either operand is NaN, the result is NaN. - The sign of the result equals the sign of the dividend. - If the dividend is an infinity, or the divisor is a zero, or both, the result is NaN. - If the dividend is finite and the divisor is an infinity, the result equals the dividend. - If the dividend is a zero and the divisor is finite, the result is the same as the dividend. - In the remaining cases, where neither an infinity, nor a zero, nor NaN is involved, the floating-point remainder r - from a dividend n and a divisor d is defined by the mathematical relation r = n (d * q) where q is an integer that - is negative only if n/d is negative and positive only if n/d is positive, and whose magnitude is as large as - possible without exceeding the magnitude of the true mathematical quotient of n and d. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.5.3"; - var VERSION = "ECMA_1"; - startTest(); - var testcases = getTestCases(); - var BUGNUMBER="111202"; - - writeHeaderToLog( SECTION + " Applying the % operator"); - 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(); - var item = 0; - - // if either operand is NaN, the result is NaN. - - array[item++] = new TestCase( SECTION, "Number.NaN % Number.NaN", Number.NaN, Number.NaN % Number.NaN ); - array[item++] = new TestCase( SECTION, "Number.NaN % 1", Number.NaN, Number.NaN % 1 ); - array[item++] = new TestCase( SECTION, "1 % Number.NaN", Number.NaN, 1 % Number.NaN ); - - array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY % Number.NaN", Number.NaN, Number.POSITIVE_INFINITY % Number.NaN ); - array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY % Number.NaN", Number.NaN, Number.NEGATIVE_INFINITY % Number.NaN ); - - // If the dividend is an infinity, or the divisor is a zero, or both, the result is NaN. - // dividend is an infinity - - array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY % Number.NEGATIVE_INFINITY", Number.NaN, Number.NEGATIVE_INFINITY % Number.NEGATIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY % Number.NEGATIVE_INFINITY", Number.NaN, Number.POSITIVE_INFINITY % Number.NEGATIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY % Number.POSITIVE_INFINITY", Number.NaN, Number.NEGATIVE_INFINITY % Number.POSITIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY % Number.POSITIVE_INFINITY", Number.NaN, Number.POSITIVE_INFINITY % Number.POSITIVE_INFINITY ); - - array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY % 0", Number.NaN, Number.POSITIVE_INFINITY % 0 ); - array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY % 0", Number.NaN, Number.NEGATIVE_INFINITY % 0 ); - array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY % -0", Number.NaN, Number.POSITIVE_INFINITY % -0 ); - array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY % -0", Number.NaN, Number.NEGATIVE_INFINITY % -0 ); - - array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY % 1 ", Number.NaN, Number.NEGATIVE_INFINITY % 1 ); - array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY % -1 ", Number.NaN, Number.NEGATIVE_INFINITY % -1 ); - array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY % 1 ", Number.NaN, Number.POSITIVE_INFINITY % 1 ); - array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY % -1 ", Number.NaN, Number.POSITIVE_INFINITY % -1 ); - - array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY % Number.MAX_VALUE ", Number.NaN, Number.NEGATIVE_INFINITY % Number.MAX_VALUE ); - array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY % -Number.MAX_VALUE ", Number.NaN, Number.NEGATIVE_INFINITY % -Number.MAX_VALUE ); - array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY % Number.MAX_VALUE ", Number.NaN, Number.POSITIVE_INFINITY % Number.MAX_VALUE ); - array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY % -Number.MAX_VALUE ", Number.NaN, Number.POSITIVE_INFINITY % -Number.MAX_VALUE ); - - // divisor is 0 - array[item++] = new TestCase( SECTION, "0 % -0", Number.NaN, 0 % -0 ); - array[item++] = new TestCase( SECTION, "-0 % 0", Number.NaN, -0 % 0 ); - array[item++] = new TestCase( SECTION, "-0 % -0", Number.NaN, -0 % -0 ); - array[item++] = new TestCase( SECTION, "0 % 0", Number.NaN, 0 % 0 ); - - array[item++] = new TestCase( SECTION, "1 % 0", Number.NaN, 1%0 ); - array[item++] = new TestCase( SECTION, "1 % -0", Number.NaN, 1%-0 ); - array[item++] = new TestCase( SECTION, "-1 % 0", Number.NaN, -1%0 ); - array[item++] = new TestCase( SECTION, "-1 % -0", Number.NaN, -1%-0 ); - - array[item++] = new TestCase( SECTION, "Number.MAX_VALUE % 0", Number.NaN, Number.MAX_VALUE%0 ); - array[item++] = new TestCase( SECTION, "Number.MAX_VALUE % -0", Number.NaN, Number.MAX_VALUE%-0 ); - array[item++] = new TestCase( SECTION, "-Number.MAX_VALUE % 0", Number.NaN, -Number.MAX_VALUE%0 ); - array[item++] = new TestCase( SECTION, "-Number.MAX_VALUE % -0", Number.NaN, -Number.MAX_VALUE%-0 ); - - // If the dividend is finite and the divisor is an infinity, the result equals the dividend. - - array[item++] = new TestCase( SECTION, "1 % Number.NEGATIVE_INFINITY", 1, 1 % Number.NEGATIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "1 % Number.POSITIVE_INFINITY", 1, 1 % Number.POSITIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "-1 % Number.POSITIVE_INFINITY", -1, -1 % Number.POSITIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "-1 % Number.NEGATIVE_INFINITY", -1, -1 % Number.NEGATIVE_INFINITY ); - - array[item++] = new TestCase( SECTION, "Number.MAX_VALUE % Number.NEGATIVE_INFINITY", Number.MAX_VALUE, Number.MAX_VALUE % Number.NEGATIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "Number.MAX_VALUE % Number.POSITIVE_INFINITY", Number.MAX_VALUE, Number.MAX_VALUE % Number.POSITIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "-Number.MAX_VALUE % Number.POSITIVE_INFINITY", -Number.MAX_VALUE, -Number.MAX_VALUE % Number.POSITIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "-Number.MAX_VALUE % Number.NEGATIVE_INFINITY", -Number.MAX_VALUE, -Number.MAX_VALUE % Number.NEGATIVE_INFINITY ); - - array[item++] = new TestCase( SECTION, "0 % Number.POSITIVE_INFINITY", 0, 0 % Number.POSITIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "0 % Number.NEGATIVE_INFINITY", 0, 0 % Number.NEGATIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "-0 % Number.POSITIVE_INFINITY", -0, -0 % Number.POSITIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "-0 % Number.NEGATIVE_INFINITY", -0, -0 % Number.NEGATIVE_INFINITY ); - - // If the dividend is a zero and the divisor is finite, the result is the same as the dividend. - - array[item++] = new TestCase( SECTION, "0 % 1", 0, 0 % 1 ); - array[item++] = new TestCase( SECTION, "0 % -1", -0, 0 % -1 ); - array[item++] = new TestCase( SECTION, "-0 % 1", -0, -0 % 1 ); - array[item++] = new TestCase( SECTION, "-0 % -1", 0, -0 % -1 ); - -// In the remaining cases, where neither an infinity, nor a zero, nor NaN is involved, the floating-point remainder r -// from a dividend n and a divisor d is defined by the mathematical relation r = n (d * q) where q is an integer that -// is negative only if n/d is negative and positive only if n/d is positive, and whose magnitude is as large as -// possible without exceeding the magnitude of the true mathematical quotient of n and d. - - return ( array ); -} diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.6.1-1.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.6.1-1.js deleted file mode 100644 index 58e5edc..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.6.1-1.js +++ /dev/null @@ -1,211 +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: 11.6.1-1.js - ECMA Section: 11.6.1 The addition operator ( + ) - Description: - - The addition operator either performs string concatenation or numeric - addition. - - The production AdditiveExpression : AdditiveExpression + MultiplicativeExpression - is evaluated as follows: - - 1. Evaluate AdditiveExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate MultiplicativeExpression. - 4. Call GetValue(Result(3)). - 5. Call ToPrimitive(Result(2)). - 6. Call ToPrimitive(Result(4)). - 7. If Type(Result(5)) is String or Type(Result(6)) is String, go to step 12. - (Note that this step differs from step 3 in the algorithm for comparison - for the relational operators in using or instead of and.) - 8. Call ToNumber(Result(5)). - 9. Call ToNumber(Result(6)). - 10. Apply the addition operation to Result(8) and Result(9). See the discussion below (11.6.3). - 11. Return Result(10). - 12. Call ToString(Result(5)). - 13. Call ToString(Result(6)). - 14. Concatenate Result(12) followed by Result(13). - 15. Return Result(14). - - Note that no hint is provided in the calls to ToPrimitive in steps 5 and 6. - All native ECMAScript objects except Date objects handle the absence of a - hint as if the hint Number were given; Date objects handle the absence of a - hint as if the hint String were given. Host objects may handle the absence - of a hint in some other manner. - - This test does not cover cases where the Additive or Mulplicative expression - ToPrimitive is string. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.6.1-1"; - var VERSION = "ECMA_1"; - startTest(); - - var testcases = getTestCases(); - - writeHeaderToLog( SECTION + " The Addition operator ( + )"); - 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(); - var item = 0; - - // tests for boolean primitive, boolean object, Object object, a "MyObject" whose value is - // a boolean primitive and a boolean object, and "MyValuelessObject", where the value is - // set in the object's prototype, not the object itself. - - array[item++] = new TestCase( SECTION, - "var EXP_1 = true; var EXP_2 = false; EXP_1 + EXP_2", - 1, - eval("var EXP_1 = true; var EXP_2 = false; EXP_1 + EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new Boolean(true); var EXP_2 = new Boolean(false); EXP_1 + EXP_2", - 1, - eval("var EXP_1 = new Boolean(true); var EXP_2 = new Boolean(false); EXP_1 + EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new Object(true); var EXP_2 = new Object(false); EXP_1 + EXP_2", - 1, - eval("var EXP_1 = new Object(true); var EXP_2 = new Object(false); EXP_1 + EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new Object(new Boolean(true)); var EXP_2 = new Object(new Boolean(false)); EXP_1 + EXP_2", - 1, - eval("var EXP_1 = new Object(new Boolean(true)); var EXP_2 = new Object(new Boolean(false)); EXP_1 + EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new MyObject(true); var EXP_2 = new MyObject(false); EXP_1 + EXP_2", - 1, - eval("var EXP_1 = new MyObject(true); var EXP_2 = new MyObject(false); EXP_1 + EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new MyObject(new Boolean(true)); var EXP_2 = new MyObject(new Boolean(false)); EXP_1 + EXP_2", - "[object Object][object Object]", - eval("var EXP_1 = new MyObject(new Boolean(true)); var EXP_2 = new MyObject(new Boolean(false)); EXP_1 + EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new MyValuelessObject(true); var EXP_2 = new MyValuelessObject(false); EXP_1 + EXP_2", - 1, - eval("var EXP_1 = new MyValuelessObject(true); var EXP_2 = new MyValuelessObject(false); EXP_1 + EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new MyValuelessObject(new Boolean(true)); var EXP_2 = new MyValuelessObject(new Boolean(false)); EXP_1 + EXP_2", - "truefalse", - eval("var EXP_1 = new MyValuelessObject(new Boolean(true)); var EXP_2 = new MyValuelessObject(new Boolean(false)); EXP_1 + EXP_2") ); - - // tests for number primitive, number object, Object object, a "MyObject" whose value is - // a number primitive and a number object, and "MyValuelessObject", where the value is - // set in the object's prototype, not the object itself. - - array[item++] = new TestCase( SECTION, - "var EXP_1 = 100; var EXP_2 = -1; EXP_1 + EXP_2", - 99, - eval("var EXP_1 = 100; var EXP_2 = -1; EXP_1 + EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new Number(100); var EXP_2 = new Number(-1); EXP_1 + EXP_2", - 99, - eval("var EXP_1 = new Number(100); var EXP_2 = new Number(-1); EXP_1 + EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new Object(100); var EXP_2 = new Object(-1); EXP_1 + EXP_2", - 99, - eval("var EXP_1 = new Object(100); var EXP_2 = new Object(-1); EXP_1 + EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new Object(new Number(100)); var EXP_2 = new Object(new Number(-1)); EXP_1 + EXP_2", - 99, - eval("var EXP_1 = new Object(new Number(100)); var EXP_2 = new Object(new Number(-1)); EXP_1 + EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new MyObject(100); var EXP_2 = new MyObject(-1); EXP_1 + EXP_2", - 99, - eval("var EXP_1 = new MyObject(100); var EXP_2 = new MyObject(-1); EXP_1 + EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new MyObject(new Number(100)); var EXP_2 = new MyObject(new Number(-1)); EXP_1 + EXP_2", - "[object Object][object Object]", - eval("var EXP_1 = new MyObject(new Number(100)); var EXP_2 = new MyObject(new Number(-1)); EXP_1 + EXP_2") ); - - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new MyValuelessObject(100); var EXP_2 = new MyValuelessObject(-1); EXP_1 + EXP_2", - 99, - eval("var EXP_1 = new MyValuelessObject(100); var EXP_2 = new MyValuelessObject(-1); EXP_1 + EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new MyValuelessObject(new Number(100)); var EXP_2 = new MyValuelessObject(new Number(-1)); EXP_1 + EXP_2", - "100-1", - eval("var EXP_1 = new MyValuelessObject(new Number(100)); var EXP_2 = new MyValuelessObject(new Number(-1)); EXP_1 + EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new MyValuelessObject( new MyValuelessObject( new Boolean(true) ) ); EXP_1 + EXP_1", - "truetrue", - eval("var EXP_1 = new MyValuelessObject( new MyValuelessObject( new Boolean(true) ) ); EXP_1 + EXP_1") ); - - return ( array ); -} - - -function MyProtoValuelessObject() { - this.valueOf = new Function ( "" ); - this.__proto__ = null; -} - -function MyProtolessObject( value ) { - this.valueOf = new Function( "return this.value" ); - this.__proto__ = null; - this.value = value; -} - -function MyValuelessObject(value) { - this.__proto__ = new MyPrototypeObject(value); -} -function MyPrototypeObject(value) { - this.valueOf = new Function( "return this.value;" ); - this.toString = new Function( "return (this.value + '');" ); - this.value = value; -} - -function MyObject( value ) { - this.valueOf = new Function( "return this.value" ); - this.value = value; -} diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.6.1-2.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.6.1-2.js deleted file mode 100644 index 400ec71..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.6.1-2.js +++ /dev/null @@ -1,203 +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: 11.6.1-2.js - ECMA Section: 11.6.1 The addition operator ( + ) - Description: - - The addition operator either performs string concatenation or numeric - addition. - - The production AdditiveExpression : AdditiveExpression + MultiplicativeExpression - is evaluated as follows: - - 1. Evaluate AdditiveExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate MultiplicativeExpression. - 4. Call GetValue(Result(3)). - 5. Call ToPrimitive(Result(2)). - 6. Call ToPrimitive(Result(4)). - 7. If Type(Result(5)) is String or Type(Result(6)) is String, go to step 12. - (Note that this step differs from step 3 in the algorithm for comparison - for the relational operators in using or instead of and.) - 8. Call ToNumber(Result(5)). - 9. Call ToNumber(Result(6)). - 10. Apply the addition operation to Result(8) and Result(9). See the discussion below (11.6.3). - 11. Return Result(10). - 12. Call ToString(Result(5)). - 13. Call ToString(Result(6)). - 14. Concatenate Result(12) followed by Result(13). - 15. Return Result(14). - - Note that no hint is provided in the calls to ToPrimitive in steps 5 and 6. - All native ECMAScript objects except Date objects handle the absence of a - hint as if the hint Number were given; Date objects handle the absence of a - hint as if the hint String were given. Host objects may handle the absence - of a hint in some other manner. - - This test does only covers cases where the Additive or Mulplicative expression - ToPrimitive is a string. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.6.1-2"; - var VERSION = "ECMA_1"; - startTest(); - - var testcases = getTestCases(); - - writeHeaderToLog( SECTION + " The Addition operator ( + )"); - 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(); - var item = 0; - - // tests for boolean primitive, boolean object, Object object, a "MyObject" whose value is - // a boolean primitive and a boolean object, and "MyValuelessObject", where the value is - // set in the object's prototype, not the object itself. - - array[item++] = new TestCase( SECTION, - "var EXP_1 = 'string'; var EXP_2 = false; EXP_1 + EXP_2", - "stringfalse", - eval("var EXP_1 = 'string'; var EXP_2 = false; EXP_1 + EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = true; var EXP_2 = 'string'; EXP_1 + EXP_2", - "truestring", - eval("var EXP_1 = true; var EXP_2 = 'string'; EXP_1 + EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new Boolean(true); var EXP_2 = new String('string'); EXP_1 + EXP_2", - "truestring", - eval("var EXP_1 = new Boolean(true); var EXP_2 = new String('string'); EXP_1 + EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new Object(true); var EXP_2 = new Object('string'); EXP_1 + EXP_2", - "truestring", - eval("var EXP_1 = new Object(true); var EXP_2 = new Object('string'); EXP_1 + EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new Object(new String('string')); var EXP_2 = new Object(new Boolean(false)); EXP_1 + EXP_2", - "stringfalse", - eval("var EXP_1 = new Object(new String('string')); var EXP_2 = new Object(new Boolean(false)); EXP_1 + EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new MyObject(true); var EXP_2 = new MyObject('string'); EXP_1 + EXP_2", - "truestring", - eval("var EXP_1 = new MyObject(true); var EXP_2 = new MyObject('string'); EXP_1 + EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new MyObject(new String('string')); var EXP_2 = new MyObject(new Boolean(false)); EXP_1 + EXP_2", - "[object Object][object Object]", - eval("var EXP_1 = new MyObject(new String('string')); var EXP_2 = new MyObject(new Boolean(false)); EXP_1 + EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new MyValuelessObject('string'); var EXP_2 = new MyValuelessObject(false); EXP_1 + EXP_2", - "stringfalse", - eval("var EXP_1 = new MyValuelessObject('string'); var EXP_2 = new MyValuelessObject(false); EXP_1 + EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new MyValuelessObject(new String('string')); var EXP_2 = new MyValuelessObject(new Boolean(false)); EXP_1 + EXP_2", - "stringfalse", - eval("var EXP_1 = new MyValuelessObject(new String('string')); var EXP_2 = new MyValuelessObject(new Boolean(false)); EXP_1 + EXP_2") ); - - // tests for number primitive, number object, Object object, a "MyObject" whose value is - // a number primitive and a number object, and "MyValuelessObject", where the value is - // set in the object's prototype, not the object itself. - - array[item++] = new TestCase( SECTION, - "var EXP_1 = 100; var EXP_2 = 'string'; EXP_1 + EXP_2", - "100string", - eval("var EXP_1 = 100; var EXP_2 = 'string'; EXP_1 + EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new String('string'); var EXP_2 = new Number(-1); EXP_1 + EXP_2", - "string-1", - eval("var EXP_1 = new String('string'); var EXP_2 = new Number(-1); EXP_1 + EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new Object(100); var EXP_2 = new Object('string'); EXP_1 + EXP_2", - "100string", - eval("var EXP_1 = new Object(100); var EXP_2 = new Object('string'); EXP_1 + EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new Object(new String('string')); var EXP_2 = new Object(new Number(-1)); EXP_1 + EXP_2", - "string-1", - eval("var EXP_1 = new Object(new String('string')); var EXP_2 = new Object(new Number(-1)); EXP_1 + EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new MyObject(100); var EXP_2 = new MyObject('string'); EXP_1 + EXP_2", - "100string", - eval("var EXP_1 = new MyObject(100); var EXP_2 = new MyObject('string'); EXP_1 + EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new MyObject(new String('string')); var EXP_2 = new MyObject(new Number(-1)); EXP_1 + EXP_2", - "[object Object][object Object]", - eval("var EXP_1 = new MyObject(new String('string')); var EXP_2 = new MyObject(new Number(-1)); EXP_1 + EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new MyValuelessObject(100); var EXP_2 = new MyValuelessObject('string'); EXP_1 + EXP_2", - "100string", - eval("var EXP_1 = new MyValuelessObject(100); var EXP_2 = new MyValuelessObject('string'); EXP_1 + EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new MyValuelessObject(new String('string')); var EXP_2 = new MyValuelessObject(new Number(-1)); EXP_1 + EXP_2", - "string-1", - eval("var EXP_1 = new MyValuelessObject(new String('string')); var EXP_2 = new MyValuelessObject(new Number(-1)); EXP_1 + EXP_2") ); - return ( array ); -} -function MyProtoValuelessObject() { - this.valueOf = new Function ( "" ); - this.__proto__ = null; -} -function MyProtolessObject( value ) { - this.valueOf = new Function( "return this.value" ); - this.__proto__ = null; - this.value = value; -} -function MyValuelessObject(value) { - this.__proto__ = new MyPrototypeObject(value); -} -function MyPrototypeObject(value) { - this.valueOf = new Function( "return this.value;" ); - this.toString = new Function( "return (this.value + '');" ); - this.value = value; -} -function MyObject( value ) { - this.valueOf = new Function( "return this.value" ); - this.value = value; -} diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.6.1-3.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.6.1-3.js deleted file mode 100644 index a5fdc88..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.6.1-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: 11.6.1-3.js - ECMA Section: 11.6.1 The addition operator ( + ) - Description: - - The addition operator either performs string concatenation or numeric - addition. - - The production AdditiveExpression : AdditiveExpression + MultiplicativeExpression - is evaluated as follows: - - 1. Evaluate AdditiveExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate MultiplicativeExpression. - 4. Call GetValue(Result(3)). - 5. Call ToPrimitive(Result(2)). - 6. Call ToPrimitive(Result(4)). - 7. If Type(Result(5)) is String or Type(Result(6)) is String, go to step 12. - (Note that this step differs from step 3 in the algorithm for comparison - for the relational operators in using or instead of and.) - 8. Call ToNumber(Result(5)). - 9. Call ToNumber(Result(6)). - 10. Apply the addition operation to Result(8) and Result(9). See the discussion below (11.6.3). - 11. Return Result(10). - 12. Call ToString(Result(5)). - 13. Call ToString(Result(6)). - 14. Concatenate Result(12) followed by Result(13). - 15. Return Result(14). - - Note that no hint is provided in the calls to ToPrimitive in steps 5 and 6. - All native ECMAScript objects except Date objects handle the absence of a - hint as if the hint Number were given; Date objects handle the absence of a - hint as if the hint String were given. Host objects may handle the absence - of a hint in some other manner. - - This test does only covers cases where the Additive or Mulplicative expression - is a Date. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.6.1-3"; - var VERSION = "ECMA_1"; - startTest(); - var testcases = getTestCases(); - - writeHeaderToLog( SECTION + " The Addition operator ( + )"); - 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(); - var item = 0; - - // tests for boolean primitive, boolean object, Object object, a "MyObject" whose value is - // a boolean primitive and a boolean object, and "MyValuelessObject", where the value is - // set in the object's prototype, not the object itself. - - var DATE1 = new Date(); - - array[item++] = new TestCase( SECTION, - "var DATE1 = new Date(); DATE1 + DATE1", - DATE1.toString() + DATE1.toString(), - DATE1 + DATE1 ); - - array[item++] = new TestCase( SECTION, - "var DATE1 = new Date(); DATE1 + 0", - DATE1.toString() + 0, - DATE1 + 0 ); - - array[item++] = new TestCase( SECTION, - "var DATE1 = new Date(); DATE1 + new Number(0)", - DATE1.toString() + 0, - DATE1 + new Number(0) ); - - array[item++] = new TestCase( SECTION, - "var DATE1 = new Date(); DATE1 + true", - DATE1.toString() + "true", - DATE1 + true ); - - array[item++] = new TestCase( SECTION, - "var DATE1 = new Date(); DATE1 + new Boolean(true)", - DATE1.toString() + "true", - DATE1 + new Boolean(true) ); - - array[item++] = new TestCase( SECTION, - "var DATE1 = new Date(); DATE1 + new Boolean(true)", - DATE1.toString() + "true", - DATE1 + new Boolean(true) ); - - var MYOB1 = new MyObject( DATE1 ); - var MYOB2 = new MyValuelessObject( DATE1 ); - var MYOB3 = new MyProtolessObject( DATE1 ); - var MYOB4 = new MyProtoValuelessObject( DATE1 ); - - array[item++] = new TestCase( SECTION, - "MYOB1 = new MyObject(DATE1); MYOB1 + new Number(1)", - "[object Object]1", - MYOB1 + new Number(1) ); - - array[item++] = new TestCase( SECTION, - "MYOB1 = new MyObject(DATE1); MYOB1 + 1", - "[object Object]1", - MYOB1 + 1 ); - - array[item++] = new TestCase( SECTION, - "MYOB2 = new MyValuelessObject(DATE1); MYOB3 + 'string'", - DATE1.toString() + "string", - MYOB2 + 'string' ); - - array[item++] = new TestCase( SECTION, - "MYOB2 = new MyValuelessObject(DATE1); MYOB3 + new String('string')", - DATE1.toString() + "string", - MYOB2 + new String('string') ); -/* - array[item++] = new TestCase( SECTION, - "MYOB3 = new MyProtolessObject(DATE1); MYOB3 + new Boolean(true)", - DATE1.toString() + "true", - MYOB3 + new Boolean(true) ); -*/ - array[item++] = new TestCase( SECTION, - "MYOB1 = new MyObject(DATE1); MYOB1 + true", - "[object Object]true", - MYOB1 + true ); - - return ( array ); -} -function MyProtoValuelessObject() { - this.valueOf = new Function ( "" ); - this.__proto__ = null; -} -function MyProtolessObject( value ) { - this.valueOf = new Function( "return this.value" ); - this.__proto__ = null; - this.value = value; -} -function MyValuelessObject(value) { - this.__proto__ = new MyPrototypeObject(value); -} -function MyPrototypeObject(value) { - this.valueOf = new Function( "return this.value;" ); - this.toString = new Function( "return (this.value + '');" ); - this.value = value; -} -function MyObject( value ) { - this.valueOf = new Function( "return this.value" ); - this.value = value; -} diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.6.2-1.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.6.2-1.js deleted file mode 100644 index 3c1bd91..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.6.2-1.js +++ /dev/null @@ -1,199 +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: 11.6.2-1.js - ECMA Section: 11.6.2 The Subtraction operator ( - ) - Description: - - The production AdditiveExpression : AdditiveExpression - - MultiplicativeExpression is evaluated as follows: - - 1. Evaluate AdditiveExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate MultiplicativeExpression. - 4. Call GetValue(Result(3)). - 5. Call ToNumber(Result(2)). - 6. Call ToNumber(Result(4)). - 7. Apply the subtraction operation to Result(5) and Result(6). See the - discussion below (11.6.3). - 8. Return Result(7). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.6.2-1"; - var VERSION = "ECMA_1"; - startTest(); - var testcases = getTestCases(); - - writeHeaderToLog( SECTION + " The subtraction operator ( - )"); - 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(); - var item = 0; - - // tests for boolean primitive, boolean object, Object object, a "MyObject" whose value is - // a boolean primitive and a boolean object, and "MyValuelessObject", where the value is - // set in the object's prototype, not the object itself. - - array[item++] = new TestCase( SECTION, - "var EXP_1 = true; var EXP_2 = false; EXP_1 - EXP_2", - 1, - eval("var EXP_1 = true; var EXP_2 = false; EXP_1 - EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new Boolean(true); var EXP_2 = new Boolean(false); EXP_1 - EXP_2", - 1, - eval("var EXP_1 = new Boolean(true); var EXP_2 = new Boolean(false); EXP_1 - EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new Object(true); var EXP_2 = new Object(false); EXP_1 - EXP_2", - 1, - eval("var EXP_1 = new Object(true); var EXP_2 = new Object(false); EXP_1 - EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new Object(new Boolean(true)); var EXP_2 = new Object(new Boolean(false)); EXP_1 - EXP_2", - 1, - eval("var EXP_1 = new Object(new Boolean(true)); var EXP_2 = new Object(new Boolean(false)); EXP_1 - EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new MyObject(true); var EXP_2 = new MyObject(false); EXP_1 - EXP_2", - 1, - eval("var EXP_1 = new MyObject(true); var EXP_2 = new MyObject(false); EXP_1 - EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new MyObject(new Boolean(true)); var EXP_2 = new MyObject(new Boolean(false)); EXP_1 - EXP_2", - Number.NaN, - eval("var EXP_1 = new MyObject(new Boolean(true)); var EXP_2 = new MyObject(new Boolean(false)); EXP_1 - EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new MyOtherObject(new Boolean(true)); var EXP_2 = new MyOtherObject(new Boolean(false)); EXP_1 - EXP_2", - Number.NaN, - eval("var EXP_1 = new MyOtherObject(new Boolean(true)); var EXP_2 = new MyOtherObject(new Boolean(false)); EXP_1 - EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new MyValuelessObject(true); var EXP_2 = new MyValuelessObject(false); EXP_1 - EXP_2", - 1, - eval("var EXP_1 = new MyValuelessObject(true); var EXP_2 = new MyValuelessObject(false); EXP_1 - EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new MyValuelessObject(new Boolean(true)); var EXP_2 = new MyValuelessObject(new Boolean(false)); EXP_1 - EXP_2", - Number.NaN, - eval("var EXP_1 = new MyValuelessObject(new Boolean(true)); var EXP_2 = new MyValuelessObject(new Boolean(false)); EXP_1 - EXP_2") ); - - // tests for number primitive, number object, Object object, a "MyObject" whose value is - // a number primitive and a number object, and "MyValuelessObject", where the value is - // set in the object's prototype, not the object itself. - - array[item++] = new TestCase( SECTION, - "var EXP_1 = 100; var EXP_2 = 1; EXP_1 - EXP_2", - 99, - eval("var EXP_1 = 100; var EXP_2 = 1; EXP_1 - EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new Number(100); var EXP_2 = new Number(1); EXP_1 - EXP_2", - 99, - eval("var EXP_1 = new Number(100); var EXP_2 = new Number(1); EXP_1 - EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new Object(100); var EXP_2 = new Object(1); EXP_1 - EXP_2", - 99, - eval("var EXP_1 = new Object(100); var EXP_2 = new Object(1); EXP_1 - EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new Object(new Number(100)); var EXP_2 = new Object(new Number(1)); EXP_1 - EXP_2", - 99, - eval("var EXP_1 = new Object(new Number(100)); var EXP_2 = new Object(new Number(1)); EXP_1 - EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new MyObject(100); var EXP_2 = new MyObject(1); EXP_1 - EXP_2", - 99, - eval("var EXP_1 = new MyObject(100); var EXP_2 = new MyObject(1); EXP_1 - EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new MyObject(new Number(100)); var EXP_2 = new MyObject(new Number(1)); EXP_1 - EXP_2", - Number.NaN, - eval("var EXP_1 = new MyObject(new Number(100)); var EXP_2 = new MyObject(new Number(1)); EXP_1 - EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new MyOtherObject(new Number(100)); var EXP_2 = new MyOtherObject(new Number(1)); EXP_1 - EXP_2", - 99, - eval("var EXP_1 = new MyOtherObject(new Number(100)); var EXP_2 = new MyOtherObject(new Number(1)); EXP_1 - EXP_2") ); - - array[item++] = new TestCase( SECTION, - "var EXP_1 = new MyValuelessObject(100); var EXP_2 = new MyValuelessObject(1); EXP_1 - EXP_2", - 99, - eval("var EXP_1 = new MyValuelessObject(100); var EXP_2 = new MyValuelessObject(1); EXP_1 - EXP_2") ); -/* - array[item++] = new TestCase( SECTION, - "var EXP_1 = new MyValuelessObject(new Number(100)); var EXP_2 = new MyValuelessObject(new Number(1)); EXP_1 - EXP_2", - Number.NaN, - eval("var EXP_1 = new MyValuelessObject(new Number(100)); var EXP_2 = new MyValuelessObject(new Number(1)); EXP_1 - EXP_2") ); -*/ - // same thing with string! - array[item++] = new TestCase( SECTION, - "var EXP_1 = new MyOtherObject(new String('0xff')); var EXP_2 = new MyOtherObject(new String('1'); EXP_1 - EXP_2", - 254, - eval("var EXP_1 = new MyOtherObject(new String('0xff')); var EXP_2 = new MyOtherObject(new String('1')); EXP_1 - EXP_2") ); - - return ( array ); -} -function MyProtoValuelessObject() { - this.valueOf = new Function ( "" ); - this.__proto__ = null; -} -function MyProtolessObject( value ) { - this.valueOf = new Function( "return this.value" ); - this.__proto__ = null; - this.value = value; -} -function MyValuelessObject(value) { - this.__proto__ = new MyPrototypeObject(value); -} -function MyPrototypeObject(value) { - this.valueOf = new Function( "return this.value;" ); - this.toString = new Function( "return (this.value + '');" ); - this.value = value; -} -function MyObject( value ) { - this.valueOf = new Function( "return this.value" ); - this.value = value; -} -function MyOtherObject( value ) { - this.valueOf = new Function( "return this.value" ); - this.toString = new Function ( "return this.value + ''" ); - this.value = value; -} diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.6.3.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.6.3.js deleted file mode 100644 index 91af1b7..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.6.3.js +++ /dev/null @@ -1,116 +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: 11.6.3.js - ECMA Section: 11.6.3 Applying the additive operators - (+, -) to numbers - Description: - The + operator performs addition when applied to two operands of numeric - type, producing the sum of the operands. The - operator performs - subtraction, producing the difference of two numeric operands. - - Addition is a commutative operation, but not always associative. - - The result of an addition is determined using the rules of IEEE 754 - double-precision arithmetic: - - If either operand is NaN, the result is NaN. - The sum of two infinities of opposite sign is NaN. - The sum of two infinities of the same sign is the infinity of that sign. - The sum of an infinity and a finite value is equal to the infinite operand. - The sum of two negative zeros is 0. The sum of two positive zeros, or of - two zeros of opposite sign, is +0. - The sum of a zero and a nonzero finite value is equal to the nonzero - operand. - The sum of two nonzero finite values of the same magnitude and opposite - sign is +0. - In the remaining cases, where neither an infinity, nor a zero, nor NaN is - involved, and the operands have the same sign or have different - magnitudes, the sum is computed and rounded to the nearest - representable value using IEEE 754 round-to-nearest mode. If the - magnitude is too large to represent, the operation overflows and - the result is then an infinity of appropriate sign. The ECMAScript - language requires support of gradual underflow as defined by IEEE 754. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.6.3"; - var VERSION = "ECMA_1"; - startTest(); - var testcases = getTestCases(); - - writeHeaderToLog( SECTION + " Applying the additive operators (+,-) to numbers"); - 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(); - var item = 0; - - array[item++] = new TestCase( SECTION, "Number.NaN + 1", Number.NaN, Number.NaN + 1 ); - array[item++] = new TestCase( SECTION, "1 + Number.NaN", Number.NaN, 1 + Number.NaN ); - - array[item++] = new TestCase( SECTION, "Number.NaN - 1", Number.NaN, Number.NaN - 1 ); - array[item++] = new TestCase( SECTION, "1 - Number.NaN", Number.NaN, 1 - Number.NaN ); - - array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY + Number.POSITIVE_INFINITY", Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY + Number.POSITIVE_INFINITY); - array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY + Number.NEGATIVE_INFINITY", Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY + Number.NEGATIVE_INFINITY); - - array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY + Number.NEGATIVE_INFINITY", Number.NaN, Number.POSITIVE_INFINITY + Number.NEGATIVE_INFINITY); - array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY + Number.POSITIVE_INFINITY", Number.NaN, Number.NEGATIVE_INFINITY + Number.POSITIVE_INFINITY); - - array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY - Number.POSITIVE_INFINITY", Number.NaN, Number.POSITIVE_INFINITY - Number.POSITIVE_INFINITY); - array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY - Number.NEGATIVE_INFINITY", Number.NaN, Number.NEGATIVE_INFINITY - Number.NEGATIVE_INFINITY); - - array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY - Number.NEGATIVE_INFINITY", Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY - Number.NEGATIVE_INFINITY); - array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY - Number.POSITIVE_INFINITY", Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY - Number.POSITIVE_INFINITY); - - array[item++] = new TestCase( SECTION, "-0 + -0", -0, -0 + -0 ); - array[item++] = new TestCase( SECTION, "-0 - 0", -0, -0 - 0 ); - - array[item++] = new TestCase( SECTION, "0 + 0", 0, 0 + 0 ); - array[item++] = new TestCase( SECTION, "0 + -0", 0, 0 + -0 ); - array[item++] = new TestCase( SECTION, "0 - -0", 0, 0 - -0 ); - array[item++] = new TestCase( SECTION, "0 - 0", 0, 0 - 0 ); - array[item++] = new TestCase( SECTION, "-0 - -0", 0, -0 - -0 ); - array[item++] = new TestCase( SECTION, "-0 + 0", 0, -0 + 0 ); - - array[item++] = new TestCase( SECTION, "Number.MAX_VALUE - Number.MAX_VALUE", 0, Number.MAX_VALUE - Number.MAX_VALUE ); - array[item++] = new TestCase( SECTION, "1/Number.MAX_VALUE - 1/Number.MAX_VALUE", 0, 1/Number.MAX_VALUE - 1/Number.MAX_VALUE ); - - array[item++] = new TestCase( SECTION, "Number.MIN_VALUE - Number.MIN_VALUE", 0, Number.MIN_VALUE - Number.MIN_VALUE ); - - return ( array ); -} diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.7.1.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.7.1.js deleted file mode 100644 index 23e2ab5..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.7.1.js +++ /dev/null @@ -1,229 +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: 11.7.1.js - ECMA Section: 11.7.1 The Left Shift Operator ( << ) - Description: - Performs a bitwise left shift operation on the left argument by the amount - specified by the right argument. - - The production ShiftExpression : ShiftExpression << AdditiveExpression is - evaluated as follows: - - 1. Evaluate ShiftExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate AdditiveExpression. - 4. Call GetValue(Result(3)). - 5. Call ToInt32(Result(2)). - 6. Call ToUint32(Result(4)). - 7. Mask out all but the least significant 5 bits of Result(6), that is, - compute Result(6) & 0x1F. - 8. Left shift Result(5) by Result(7) bits. The result is a signed 32 bit - integer. - 9. Return Result(8). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.7.1"; - var VERSION = "ECMA_1"; - startTest(); - - var testcases = getTestCases(); - - writeHeaderToLog( SECTION + " The left shift operator ( << )"); - 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(); - var item = 0; - - for ( power = 0; power < 33; power++ ) { - shiftexp = Math.pow( 2, power ); - - for ( addexp = 0; addexp < 33; addexp++ ) { - array[item++] = new TestCase( SECTION, - shiftexp + " << " + addexp, - LeftShift( shiftexp, addexp ), - shiftexp << addexp ); - } - } - - return ( array ); -} -function ToInteger( n ) { - n = Number( n ); - var sign = ( n < 0 ) ? -1 : 1; - - if ( n != n ) { - return 0; - } - if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY ) { - return n; - } - return ( sign * Math.floor(Math.abs(n)) ); -} -function ToInt32( 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) )) % Math.pow(2,32); - n = ( n >= Math.pow(2,31) ) ? n - Math.pow(2,32) : n; - - return ( n ); -} -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 ); -} -function ToUint16( 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) ) ) % Math.pow(2,16); - - if (n <0) { - n += Math.pow(2,16); - } - - return ( n ); -} -function Mask( b, n ) { - b = ToUint32BitString( b ); - b = b.substring( b.length - n ); - b = ToUint32Decimal( b ); - return ( b ); -} -function ToUint32BitString( n ) { - var b = ""; - for ( p = 31; p >=0; p-- ) { - if ( n >= Math.pow(2,p) ) { - b += "1"; - n -= Math.pow(2,p); - } else { - b += "0"; - } - } - return b; -} -function ToInt32BitString( n ) { - var b = ""; - var sign = ( n < 0 ) ? -1 : 1; - - b += ( sign == 1 ) ? "0" : "1"; - - for ( p = 30; p >=0; p-- ) { - if ( (sign == 1 ) ? sign * n >= Math.pow(2,p) : sign * n > Math.pow(2,p) ) { - b += ( sign == 1 ) ? "1" : "0"; - n -= sign * Math.pow( 2, p ); - } else { - b += ( sign == 1 ) ? "0" : "1"; - } - } - - return b; -} -function ToInt32Decimal( bin ) { - var r = 0; - var sign; - - if ( Number(bin.charAt(0)) == 0 ) { - sign = 1; - r = 0; - } else { - sign = -1; - r = -(Math.pow(2,31)); - } - - for ( var j = 0; j < 31; j++ ) { - r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); - } - - return r; -} -function ToUint32Decimal( bin ) { - var r = 0; - - - for ( l = bin.length; l < 32; l++ ) { - bin = "0" + bin; - } - - for ( j = 0; j < 31; j++ ) { - r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); - - } - - return r; -} -function LeftShift( s, a ) { - var shift = ToInt32( s ); - var add = ToUint32( a ); - add = Mask( add, 5 ); - var exp = LShift( shift, add ); - - return ( exp ); -} -function LShift( s, a ) { - s = ToInt32BitString( s ); - - for ( var z = 0; z < a; z++ ) { - s += "0"; - } - - s = s.substring( a, s.length); - - return ToInt32(ToInt32Decimal(s)); -} diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.7.2.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.7.2.js deleted file mode 100644 index b2761cf..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.7.2.js +++ /dev/null @@ -1,246 +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: 11.7.2.js - ECMA Section: 11.7.2 The signed right shift operator ( >> ) - Description: - Performs a sign-filling bitwise right shift operation on the left argument - by the amount specified by the right argument. - - The production ShiftExpression : ShiftExpression >> AdditiveExpression is - evaluated as follows: - - 1. Evaluate ShiftExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate AdditiveExpression. - 4. Call GetValue(Result(3)). - 5. Call ToInt32(Result(2)). - 6. Call ToUint32(Result(4)). - 7. Mask out all but the least significant 5 bits of Result(6), that is, - compute Result(6) & 0x1F. - 8. Perform sign-extending right shift of Result(5) by Result(7) bits. The - most significant bit is propagated. The result is a signed 32 bit - integer. - 9. Return Result(8). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.7.2"; - var VERSION = "ECMA_1"; - startTest(); - var testcases = getTestCases(); - - writeHeaderToLog( SECTION + " The signed right shift operator ( >> )"); - 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(); - var item = 0; - var power = 0; - var addexp = 0; - - for ( power = 0; power <= 32; power++ ) { - shiftexp = Math.pow( 2, power ); - - for ( addexp = 0; addexp <= 32; addexp++ ) { - array[item++] = new TestCase( SECTION, - shiftexp + " >> " + addexp, - SignedRightShift( shiftexp, addexp ), - shiftexp >> addexp ); - } - } - - for ( power = 0; power <= 32; power++ ) { - shiftexp = -Math.pow( 2, power ); - - for ( addexp = 0; addexp <= 32; addexp++ ) { - array[item++] = new TestCase( SECTION, - shiftexp + " >> " + addexp, - SignedRightShift( shiftexp, addexp ), - shiftexp >> addexp ); - } - } - - return ( array ); -} - -function ToInteger( n ) { - n = Number( n ); - var sign = ( n < 0 ) ? -1 : 1; - - if ( n != n ) { - return 0; - } - if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY ) { - return n; - } - return ( sign * Math.floor(Math.abs(n)) ); -} -function ToInt32( 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) )) % Math.pow(2,32); - n = ( n >= Math.pow(2,31) ) ? n - Math.pow(2,32) : n; - - return ( n ); -} -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 ); -} -function ToUint16( 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) ) ) % Math.pow(2,16); - - if (n <0) { - n += Math.pow(2,16); - } - - return ( n ); -} -function Mask( b, n ) { - b = ToUint32BitString( b ); - b = b.substring( b.length - n ); - b = ToUint32Decimal( b ); - return ( b ); -} -function ToUint32BitString( n ) { - var b = ""; - for ( p = 31; p >=0; p-- ) { - if ( n >= Math.pow(2,p) ) { - b += "1"; - n -= Math.pow(2,p); - } else { - b += "0"; - } - } - return b; -} -function ToInt32BitString( n ) { - var b = ""; - var sign = ( n < 0 ) ? -1 : 1; - - b += ( sign == 1 ) ? "0" : "1"; - - for ( p = 30; p >=0; p-- ) { - if ( (sign == 1 ) ? sign * n >= Math.pow(2,p) : sign * n > Math.pow(2,p) ) { - b += ( sign == 1 ) ? "1" : "0"; - n -= sign * Math.pow( 2, p ); - } else { - b += ( sign == 1 ) ? "0" : "1"; - } - } - - return b; -} -function ToInt32Decimal( bin ) { - var r = 0; - var sign; - - if ( Number(bin.charAt(0)) == 0 ) { - sign = 1; - r = 0; - } else { - sign = -1; - r = -(Math.pow(2,31)); - } - - for ( var j = 0; j < 31; j++ ) { - r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); - } - - return r; -} -function ToUint32Decimal( bin ) { - var r = 0; - - for ( l = bin.length; l < 32; l++ ) { - bin = "0" + bin; - } - - for ( j = 0; j < 31; j++ ) { - r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); - } - - return r; -} -function SignedRightShift( s, a ) { - s = ToInt32( s ); - a = ToUint32( a ); - a = Mask( a, 5 ); - return ( SignedRShift( s, a ) ); -} -function SignedRShift( s, a ) { - s = ToInt32BitString( s ); - - var firstbit = s.substring(0,1); - - s = s.substring( 1, s.length ); - - for ( var z = 0; z < a; z++ ) { - s = firstbit + s; - } - - s = s.substring( 0, s.length - a); - - s = firstbit +s; - - - return ToInt32(ToInt32Decimal(s)); -}
\ No newline at end of file diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.7.3.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.7.3.js deleted file mode 100644 index 9c963e1..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.7.3.js +++ /dev/null @@ -1,230 +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: 11.7.3.js - ECMA Section: 11.7.3 The unsigned right shift operator ( >>> ) - Description: - 11.7.3 The unsigned right shift operator ( >>> ) - Performs a zero-filling bitwise right shift operation on the left argument - by the amount specified by the right argument. - - The production ShiftExpression : ShiftExpression >>> AdditiveExpression is - evaluated as follows: - - 1. Evaluate ShiftExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate AdditiveExpression. - 4. Call GetValue(Result(3)). - 5. Call ToUint32(Result(2)). - 6. Call ToUint32(Result(4)). - 7. Mask out all but the least significant 5 bits of Result(6), that is, - compute Result(6) & 0x1F. - 8. Perform zero-filling right shift of Result(5) by Result(7) bits. - Vacated bits are filled with zero. The result is an unsigned 32 bit - integer. - 9. Return Result(8). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.7.3"; - var VERSION = "ECMA_1"; - startTest(); - var testcases = getTestCases(); - - writeHeaderToLog( SECTION + " The unsigned right shift operator ( >>> )"); - 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(); - var item = 0; - - var addexp = 0; - var power = 0; - - for ( power = 0; power <= 32; power++ ) { - shiftexp = Math.pow( 2, power ); - - for ( addexp = 0; addexp <= 32; addexp++ ) { - array[item++] = new TestCase( SECTION, - shiftexp + " >>> " + addexp, - UnsignedRightShift( shiftexp, addexp ), - shiftexp >>> addexp ); - } - } - - return ( array ); -} - -function ToInteger( n ) { - n = Number( n ); - var sign = ( n < 0 ) ? -1 : 1; - - if ( n != n ) { - return 0; - } - if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY ) { - return n; - } - return ( sign * Math.floor(Math.abs(n)) ); -} -function ToInt32( 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) )) % Math.pow(2,32); - n = ( n >= Math.pow(2,31) ) ? n - Math.pow(2,32) : n; - - return ( n ); -} -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 ); -} -function ToUint16( 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) ) ) % Math.pow(2,16); - - if (n <0) { - n += Math.pow(2,16); - } - - return ( n ); -} -function Mask( b, n ) { - b = ToUint32BitString( b ); - b = b.substring( b.length - n ); - b = ToUint32Decimal( b ); - return ( b ); -} -function ToUint32BitString( n ) { - var b = ""; - for ( p = 31; p >=0; p-- ) { - if ( n >= Math.pow(2,p) ) { - b += "1"; - n -= Math.pow(2,p); - } else { - b += "0"; - } - } - return b; -} -function ToInt32BitString( n ) { - var b = ""; - var sign = ( n < 0 ) ? -1 : 1; - - b += ( sign == 1 ) ? "0" : "1"; - - for ( p = 30; p >=0; p-- ) { - if ( (sign == 1 ) ? sign * n >= Math.pow(2,p) : sign * n > Math.pow(2,p) ) { - b += ( sign == 1 ) ? "1" : "0"; - n -= sign * Math.pow( 2, p ); - } else { - b += ( sign == 1 ) ? "0" : "1"; - } - } - - return b; -} -function ToInt32Decimal( bin ) { - var r = 0; - var sign; - - if ( Number(bin.charAt(0)) == 0 ) { - sign = 1; - r = 0; - } else { - sign = -1; - r = -(Math.pow(2,31)); - } - - for ( var j = 0; j < 31; j++ ) { - r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); - } - - return r; -} -function ToUint32Decimal( bin ) { - var r = 0; - - - for ( l = bin.length; l < 32; l++ ) { - bin = "0" + bin; - } - - for ( j = 0; j < 32; j++ ) { - r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); - - } - - return r; -} -function RShift( s, a ) { - s = ToUint32BitString( s ); - for ( z = 0; z < a; z++ ) { - s = "0" + s; - } - s = s.substring( 0, s.length - a ); - - return ToUint32Decimal(s); -} -function UnsignedRightShift( s, a ) { - s = ToUint32( s ); - a = ToUint32( a ); - a = Mask( a, 5 ); - return ( RShift( s, a ) ); -} diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.8.1.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.8.1.js deleted file mode 100644 index db2c701..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.8.1.js +++ /dev/null @@ -1,121 +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: 11.8.1.js - ECMA Section: 11.8.1 The less-than operator ( < ) - Description: - - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.8.1"; - var VERSION = "ECMA_1"; - startTest(); - var testcases = getTestCases(); - - writeHeaderToLog( SECTION + " The less-than operator ( < )"); - 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(); - var item = 0; - - array[item++] = new TestCase( SECTION, "true < false", false, true < false ); - array[item++] = new TestCase( SECTION, "false < true", true, false < true ); - array[item++] = new TestCase( SECTION, "false < false", false, false < false ); - array[item++] = new TestCase( SECTION, "true < true", false, true < true ); - - array[item++] = new TestCase( SECTION, "new Boolean(true) < new Boolean(true)", false, new Boolean(true) < new Boolean(true) ); - array[item++] = new TestCase( SECTION, "new Boolean(true) < new Boolean(false)", false, new Boolean(true) < new Boolean(false) ); - array[item++] = new TestCase( SECTION, "new Boolean(false) < new Boolean(true)", true, new Boolean(false) < new Boolean(true) ); - array[item++] = new TestCase( SECTION, "new Boolean(false) < new Boolean(false)", false, new Boolean(false) < new Boolean(false) ); - - array[item++] = new TestCase( SECTION, "new MyObject(Infinity) < new MyObject(Infinity)", false, new MyObject( Number.POSITIVE_INFINITY ) < new MyObject( Number.POSITIVE_INFINITY) ); - array[item++] = new TestCase( SECTION, "new MyObject(-Infinity) < new MyObject(Infinity)", true, new MyObject( Number.NEGATIVE_INFINITY ) < new MyObject( Number.POSITIVE_INFINITY) ); - array[item++] = new TestCase( SECTION, "new MyObject(-Infinity) < new MyObject(-Infinity)", false, new MyObject( Number.NEGATIVE_INFINITY ) < new MyObject( Number.NEGATIVE_INFINITY) ); - - array[item++] = new TestCase( SECTION, "new MyValueObject(false) < new MyValueObject(true)", true, new MyValueObject(false) < new MyValueObject(true) ); - array[item++] = new TestCase( SECTION, "new MyValueObject(true) < new MyValueObject(true)", false, new MyValueObject(true) < new MyValueObject(true) ); - array[item++] = new TestCase( SECTION, "new MyValueObject(false) < new MyValueObject(false)", false, new MyValueObject(false) < new MyValueObject(false) ); - - array[item++] = new TestCase( SECTION, "new MyStringObject(false) < new MyStringObject(true)", true, new MyStringObject(false) < new MyStringObject(true) ); - array[item++] = new TestCase( SECTION, "new MyStringObject(true) < new MyStringObject(true)", false, new MyStringObject(true) < new MyStringObject(true) ); - array[item++] = new TestCase( SECTION, "new MyStringObject(false) < new MyStringObject(false)", false, new MyStringObject(false) < new MyStringObject(false) ); - - array[item++] = new TestCase( SECTION, "Number.NaN < Number.NaN", false, Number.NaN < Number.NaN ); - array[item++] = new TestCase( SECTION, "0 < Number.NaN", false, 0 < Number.NaN ); - array[item++] = new TestCase( SECTION, "Number.NaN < 0", false, Number.NaN < 0 ); - - array[item++] = new TestCase( SECTION, "0 < -0", false, 0 < -0 ); - array[item++] = new TestCase( SECTION, "-0 < 0", false, -0 < 0 ); - - array[item++] = new TestCase( SECTION, "Infinity < 0", false, Number.POSITIVE_INFINITY < 0 ); - array[item++] = new TestCase( SECTION, "Infinity < Number.MAX_VALUE", false, Number.POSITIVE_INFINITY < Number.MAX_VALUE ); - array[item++] = new TestCase( SECTION, "Infinity < Infinity", false, Number.POSITIVE_INFINITY < Number.POSITIVE_INFINITY ); - - array[item++] = new TestCase( SECTION, "0 < Infinity", true, 0 < Number.POSITIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "Number.MAX_VALUE < Infinity", true, Number.MAX_VALUE < Number.POSITIVE_INFINITY ); - - array[item++] = new TestCase( SECTION, "0 < -Infinity", false, 0 < Number.NEGATIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "Number.MAX_VALUE < -Infinity", false, Number.MAX_VALUE < Number.NEGATIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "-Infinity < -Infinity", false, Number.NEGATIVE_INFINITY < Number.NEGATIVE_INFINITY ); - - array[item++] = new TestCase( SECTION, "-Infinity < 0", true, Number.NEGATIVE_INFINITY < 0 ); - array[item++] = new TestCase( SECTION, "-Infinity < -Number.MAX_VALUE", true, Number.NEGATIVE_INFINITY < -Number.MAX_VALUE ); - array[item++] = new TestCase( SECTION, "-Infinity < Number.MIN_VALUE", true, Number.NEGATIVE_INFINITY < Number.MIN_VALUE ); - - array[item++] = new TestCase( SECTION, "'string' < 'string'", false, 'string' < 'string' ); - array[item++] = new TestCase( SECTION, "'astring' < 'string'", true, 'astring' < 'string' ); - array[item++] = new TestCase( SECTION, "'strings' < 'stringy'", true, 'strings' < 'stringy' ); - array[item++] = new TestCase( SECTION, "'strings' < 'stringier'", false, 'strings' < 'stringier' ); - array[item++] = new TestCase( SECTION, "'string' < 'astring'", false, 'string' < 'astring' ); - array[item++] = new TestCase( SECTION, "'string' < 'strings'", true, 'string' < 'strings' ); - - return ( array ); -} -function MyObject(value) { - this.value = value; - this.valueOf = new Function( "return this.value" ); - this.toString = new Function( "return this.value +''" ); -} -function MyValueObject(value) { - this.value = value; - this.valueOf = new Function( "return this.value" ); -} -function MyStringObject(value) { - this.value = value; - this.toString = new Function( "return this.value +''" ); -}
\ No newline at end of file diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.8.2.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.8.2.js deleted file mode 100644 index 962c33e..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.8.2.js +++ /dev/null @@ -1,122 +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: 11.8.2.js - ECMA Section: 11.8.2 The greater-than operator ( > ) - Description: - - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.8.2"; - var VERSION = "ECMA_1"; - startTest(); - var testcases = getTestCases(); - - writeHeaderToLog( SECTION + " The greater-than operator ( > )"); - 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(); - var item = 0; - - array[item++] = new TestCase( SECTION, "true > false", true, true > false ); - array[item++] = new TestCase( SECTION, "false > true", false, false > true ); - array[item++] = new TestCase( SECTION, "false > false", false, false > false ); - array[item++] = new TestCase( SECTION, "true > true", false, true > true ); - - array[item++] = new TestCase( SECTION, "new Boolean(true) > new Boolean(true)", false, new Boolean(true) > new Boolean(true) ); - array[item++] = new TestCase( SECTION, "new Boolean(true) > new Boolean(false)", true, new Boolean(true) > new Boolean(false) ); - array[item++] = new TestCase( SECTION, "new Boolean(false) > new Boolean(true)", false, new Boolean(false) > new Boolean(true) ); - array[item++] = new TestCase( SECTION, "new Boolean(false) > new Boolean(false)", false, new Boolean(false) > new Boolean(false) ); - - array[item++] = new TestCase( SECTION, "new MyObject(Infinity) > new MyObject(Infinity)", false, new MyObject( Number.POSITIVE_INFINITY ) > new MyObject( Number.POSITIVE_INFINITY) ); - array[item++] = new TestCase( SECTION, "new MyObject(-Infinity) > new MyObject(Infinity)", false, new MyObject( Number.NEGATIVE_INFINITY ) > new MyObject( Number.POSITIVE_INFINITY) ); - array[item++] = new TestCase( SECTION, "new MyObject(-Infinity) > new MyObject(-Infinity)", false, new MyObject( Number.NEGATIVE_INFINITY ) > new MyObject( Number.NEGATIVE_INFINITY) ); - - array[item++] = new TestCase( SECTION, "new MyValueObject(false) > new MyValueObject(true)", false, new MyValueObject(false) > new MyValueObject(true) ); - array[item++] = new TestCase( SECTION, "new MyValueObject(true) > new MyValueObject(true)", false, new MyValueObject(true) > new MyValueObject(true) ); - array[item++] = new TestCase( SECTION, "new MyValueObject(false) > new MyValueObject(false)", false, new MyValueObject(false) > new MyValueObject(false) ); - - array[item++] = new TestCase( SECTION, "new MyStringObject(false) > new MyStringObject(true)", false, new MyStringObject(false) > new MyStringObject(true) ); - array[item++] = new TestCase( SECTION, "new MyStringObject(true) > new MyStringObject(true)", false, new MyStringObject(true) > new MyStringObject(true) ); - array[item++] = new TestCase( SECTION, "new MyStringObject(false) > new MyStringObject(false)", false, new MyStringObject(false) > new MyStringObject(false) ); - - array[item++] = new TestCase( SECTION, "Number.NaN > Number.NaN", false, Number.NaN > Number.NaN ); - array[item++] = new TestCase( SECTION, "0 > Number.NaN", false, 0 > Number.NaN ); - array[item++] = new TestCase( SECTION, "Number.NaN > 0", false, Number.NaN > 0 ); - - array[item++] = new TestCase( SECTION, "0 > -0", false, 0 > -0 ); - array[item++] = new TestCase( SECTION, "-0 > 0", false, -0 > 0 ); - - array[item++] = new TestCase( SECTION, "Infinity > 0", true, Number.POSITIVE_INFINITY > 0 ); - array[item++] = new TestCase( SECTION, "Infinity > Number.MAX_VALUE", true, Number.POSITIVE_INFINITY > Number.MAX_VALUE ); - array[item++] = new TestCase( SECTION, "Infinity > Infinity", false, Number.POSITIVE_INFINITY > Number.POSITIVE_INFINITY ); - - array[item++] = new TestCase( SECTION, "0 > Infinity", false, 0 > Number.POSITIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "Number.MAX_VALUE > Infinity", false, Number.MAX_VALUE > Number.POSITIVE_INFINITY ); - - array[item++] = new TestCase( SECTION, "0 > -Infinity", true, 0 > Number.NEGATIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "Number.MAX_VALUE > -Infinity", true, Number.MAX_VALUE > Number.NEGATIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "-Infinity > -Infinity", false, Number.NEGATIVE_INFINITY > Number.NEGATIVE_INFINITY ); - - array[item++] = new TestCase( SECTION, "-Infinity > 0", false, Number.NEGATIVE_INFINITY > 0 ); - array[item++] = new TestCase( SECTION, "-Infinity > -Number.MAX_VALUE", false, Number.NEGATIVE_INFINITY > -Number.MAX_VALUE ); - array[item++] = new TestCase( SECTION, "-Infinity > Number.MIN_VALUE", false, Number.NEGATIVE_INFINITY > Number.MIN_VALUE ); - - array[item++] = new TestCase( SECTION, "'string' > 'string'", false, 'string' > 'string' ); - array[item++] = new TestCase( SECTION, "'astring' > 'string'", false, 'astring' > 'string' ); - array[item++] = new TestCase( SECTION, "'strings' > 'stringy'", false, 'strings' > 'stringy' ); - array[item++] = new TestCase( SECTION, "'strings' > 'stringier'", true, 'strings' > 'stringier' ); - array[item++] = new TestCase( SECTION, "'string' > 'astring'", true, 'string' > 'astring' ); - array[item++] = new TestCase( SECTION, "'string' > 'strings'", false, 'string' > 'strings' ); - - - return ( array ); -} -function MyObject(value) { - this.value = value; - this.valueOf = new Function( "return this.value" ); - this.toString = new Function( "return this.value +''" ); -} -function MyValueObject(value) { - this.value = value; - this.valueOf = new Function( "return this.value" ); -} -function MyStringObject(value) { - this.value = value; - this.toString = new Function( "return this.value +''" ); -}
\ No newline at end of file diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.8.3.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.8.3.js deleted file mode 100644 index 5da73d6..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.8.3.js +++ /dev/null @@ -1,120 +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: 11.8.3.js - ECMA Section: 11.8.3 The less-than-or-equal operator ( <= ) - Description: - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.8.1"; - var VERSION = "ECMA_1"; - startTest(); - var testcases = getTestCases(); - - writeHeaderToLog( SECTION + " The less-than-or-equal operator ( <= )"); - 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(); - var item = 0; - - array[item++] = new TestCase( SECTION, "true <= false", false, true <= false ); - array[item++] = new TestCase( SECTION, "false <= true", true, false <= true ); - array[item++] = new TestCase( SECTION, "false <= false", true, false <= false ); - array[item++] = new TestCase( SECTION, "true <= true", true, true <= true ); - - array[item++] = new TestCase( SECTION, "new Boolean(true) <= new Boolean(true)", true, new Boolean(true) <= new Boolean(true) ); - array[item++] = new TestCase( SECTION, "new Boolean(true) <= new Boolean(false)", false, new Boolean(true) <= new Boolean(false) ); - array[item++] = new TestCase( SECTION, "new Boolean(false) <= new Boolean(true)", true, new Boolean(false) <= new Boolean(true) ); - array[item++] = new TestCase( SECTION, "new Boolean(false) <= new Boolean(false)", true, new Boolean(false) <= new Boolean(false) ); - - array[item++] = new TestCase( SECTION, "new MyObject(Infinity) <= new MyObject(Infinity)", true, new MyObject( Number.POSITIVE_INFINITY ) <= new MyObject( Number.POSITIVE_INFINITY) ); - array[item++] = new TestCase( SECTION, "new MyObject(-Infinity) <= new MyObject(Infinity)", true, new MyObject( Number.NEGATIVE_INFINITY ) <= new MyObject( Number.POSITIVE_INFINITY) ); - array[item++] = new TestCase( SECTION, "new MyObject(-Infinity) <= new MyObject(-Infinity)", true, new MyObject( Number.NEGATIVE_INFINITY ) <= new MyObject( Number.NEGATIVE_INFINITY) ); - - array[item++] = new TestCase( SECTION, "new MyValueObject(false) <= new MyValueObject(true)", true, new MyValueObject(false) <= new MyValueObject(true) ); - array[item++] = new TestCase( SECTION, "new MyValueObject(true) <= new MyValueObject(true)", true, new MyValueObject(true) <= new MyValueObject(true) ); - array[item++] = new TestCase( SECTION, "new MyValueObject(false) <= new MyValueObject(false)", true, new MyValueObject(false) <= new MyValueObject(false) ); - - array[item++] = new TestCase( SECTION, "new MyStringObject(false) <= new MyStringObject(true)", true, new MyStringObject(false) <= new MyStringObject(true) ); - array[item++] = new TestCase( SECTION, "new MyStringObject(true) <= new MyStringObject(true)", true, new MyStringObject(true) <= new MyStringObject(true) ); - array[item++] = new TestCase( SECTION, "new MyStringObject(false) <= new MyStringObject(false)", true, new MyStringObject(false) <= new MyStringObject(false) ); - - array[item++] = new TestCase( SECTION, "Number.NaN <= Number.NaN", false, Number.NaN <= Number.NaN ); - array[item++] = new TestCase( SECTION, "0 <= Number.NaN", false, 0 <= Number.NaN ); - array[item++] = new TestCase( SECTION, "Number.NaN <= 0", false, Number.NaN <= 0 ); - - array[item++] = new TestCase( SECTION, "0 <= -0", true, 0 <= -0 ); - array[item++] = new TestCase( SECTION, "-0 <= 0", true, -0 <= 0 ); - - array[item++] = new TestCase( SECTION, "Infinity <= 0", false, Number.POSITIVE_INFINITY <= 0 ); - array[item++] = new TestCase( SECTION, "Infinity <= Number.MAX_VALUE", false, Number.POSITIVE_INFINITY <= Number.MAX_VALUE ); - array[item++] = new TestCase( SECTION, "Infinity <= Infinity", true, Number.POSITIVE_INFINITY <= Number.POSITIVE_INFINITY ); - - array[item++] = new TestCase( SECTION, "0 <= Infinity", true, 0 <= Number.POSITIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "Number.MAX_VALUE <= Infinity", true, Number.MAX_VALUE <= Number.POSITIVE_INFINITY ); - - array[item++] = new TestCase( SECTION, "0 <= -Infinity", false, 0 <= Number.NEGATIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "Number.MAX_VALUE <= -Infinity", false, Number.MAX_VALUE <= Number.NEGATIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "-Infinity <= -Infinity", true, Number.NEGATIVE_INFINITY <= Number.NEGATIVE_INFINITY ); - - array[item++] = new TestCase( SECTION, "-Infinity <= 0", true, Number.NEGATIVE_INFINITY <= 0 ); - array[item++] = new TestCase( SECTION, "-Infinity <= -Number.MAX_VALUE", true, Number.NEGATIVE_INFINITY <= -Number.MAX_VALUE ); - array[item++] = new TestCase( SECTION, "-Infinity <= Number.MIN_VALUE", true, Number.NEGATIVE_INFINITY <= Number.MIN_VALUE ); - - array[item++] = new TestCase( SECTION, "'string' <= 'string'", true, 'string' <= 'string' ); - array[item++] = new TestCase( SECTION, "'astring' <= 'string'", true, 'astring' <= 'string' ); - array[item++] = new TestCase( SECTION, "'strings' <= 'stringy'", true, 'strings' <= 'stringy' ); - array[item++] = new TestCase( SECTION, "'strings' <= 'stringier'", false, 'strings' <= 'stringier' ); - array[item++] = new TestCase( SECTION, "'string' <= 'astring'", false, 'string' <= 'astring' ); - array[item++] = new TestCase( SECTION, "'string' <= 'strings'", true, 'string' <= 'strings' ); - - return ( array ); -} -function MyObject(value) { - this.value = value; - this.valueOf = new Function( "return this.value" ); - this.toString = new Function( "return this.value +''" ); -} -function MyValueObject(value) { - this.value = value; - this.valueOf = new Function( "return this.value" ); -} -function MyStringObject(value) { - this.value = value; - this.toString = new Function( "return this.value +''" ); -} diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.8.4.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.8.4.js deleted file mode 100644 index 7e25b05..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.8.4.js +++ /dev/null @@ -1,122 +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: 11.8.4.js - ECMA Section: 11.8.4 The greater-than-or-equal operator ( >= ) - Description: - - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.8.4"; - var VERSION = "ECMA_1"; - startTest(); - var testcases = getTestCases(); - - writeHeaderToLog( SECTION + " The greater-than-or-equal operator ( >= )"); - 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(); - var item = 0; - - array[item++] = new TestCase( SECTION, "true >= false", true, true >= false ); - array[item++] = new TestCase( SECTION, "false >= true", false, false >= true ); - array[item++] = new TestCase( SECTION, "false >= false", true, false >= false ); - array[item++] = new TestCase( SECTION, "true >= true", true, true >= true ); - - array[item++] = new TestCase( SECTION, "new Boolean(true) >= new Boolean(true)", true, new Boolean(true) >= new Boolean(true) ); - array[item++] = new TestCase( SECTION, "new Boolean(true) >= new Boolean(false)", true, new Boolean(true) >= new Boolean(false) ); - array[item++] = new TestCase( SECTION, "new Boolean(false) >= new Boolean(true)", false, new Boolean(false) >= new Boolean(true) ); - array[item++] = new TestCase( SECTION, "new Boolean(false) >= new Boolean(false)", true, new Boolean(false) >= new Boolean(false) ); - - array[item++] = new TestCase( SECTION, "new MyObject(Infinity) >= new MyObject(Infinity)", true, new MyObject( Number.POSITIVE_INFINITY ) >= new MyObject( Number.POSITIVE_INFINITY) ); - array[item++] = new TestCase( SECTION, "new MyObject(-Infinity) >= new MyObject(Infinity)", false, new MyObject( Number.NEGATIVE_INFINITY ) >= new MyObject( Number.POSITIVE_INFINITY) ); - array[item++] = new TestCase( SECTION, "new MyObject(-Infinity) >= new MyObject(-Infinity)", true, new MyObject( Number.NEGATIVE_INFINITY ) >= new MyObject( Number.NEGATIVE_INFINITY) ); - - array[item++] = new TestCase( SECTION, "new MyValueObject(false) >= new MyValueObject(true)", false, new MyValueObject(false) >= new MyValueObject(true) ); - array[item++] = new TestCase( SECTION, "new MyValueObject(true) >= new MyValueObject(true)", true, new MyValueObject(true) >= new MyValueObject(true) ); - array[item++] = new TestCase( SECTION, "new MyValueObject(false) >= new MyValueObject(false)", true, new MyValueObject(false) >= new MyValueObject(false) ); - - array[item++] = new TestCase( SECTION, "new MyStringObject(false) >= new MyStringObject(true)", false, new MyStringObject(false) >= new MyStringObject(true) ); - array[item++] = new TestCase( SECTION, "new MyStringObject(true) >= new MyStringObject(true)", true, new MyStringObject(true) >= new MyStringObject(true) ); - array[item++] = new TestCase( SECTION, "new MyStringObject(false) >= new MyStringObject(false)", true, new MyStringObject(false) >= new MyStringObject(false) ); - - array[item++] = new TestCase( SECTION, "Number.NaN >= Number.NaN", false, Number.NaN >= Number.NaN ); - array[item++] = new TestCase( SECTION, "0 >= Number.NaN", false, 0 >= Number.NaN ); - array[item++] = new TestCase( SECTION, "Number.NaN >= 0", false, Number.NaN >= 0 ); - - array[item++] = new TestCase( SECTION, "0 >= -0", true, 0 >= -0 ); - array[item++] = new TestCase( SECTION, "-0 >= 0", true, -0 >= 0 ); - - array[item++] = new TestCase( SECTION, "Infinity >= 0", true, Number.POSITIVE_INFINITY >= 0 ); - array[item++] = new TestCase( SECTION, "Infinity >= Number.MAX_VALUE", true, Number.POSITIVE_INFINITY >= Number.MAX_VALUE ); - array[item++] = new TestCase( SECTION, "Infinity >= Infinity", true, Number.POSITIVE_INFINITY >= Number.POSITIVE_INFINITY ); - - array[item++] = new TestCase( SECTION, "0 >= Infinity", false, 0 >= Number.POSITIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "Number.MAX_VALUE >= Infinity", false, Number.MAX_VALUE >= Number.POSITIVE_INFINITY ); - - array[item++] = new TestCase( SECTION, "0 >= -Infinity", true, 0 >= Number.NEGATIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "Number.MAX_VALUE >= -Infinity", true, Number.MAX_VALUE >= Number.NEGATIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "-Infinity >= -Infinity", true, Number.NEGATIVE_INFINITY >= Number.NEGATIVE_INFINITY ); - - array[item++] = new TestCase( SECTION, "-Infinity >= 0", false, Number.NEGATIVE_INFINITY >= 0 ); - array[item++] = new TestCase( SECTION, "-Infinity >= -Number.MAX_VALUE", false, Number.NEGATIVE_INFINITY >= -Number.MAX_VALUE ); - array[item++] = new TestCase( SECTION, "-Infinity >= Number.MIN_VALUE", false, Number.NEGATIVE_INFINITY >= Number.MIN_VALUE ); - - array[item++] = new TestCase( SECTION, "'string' > 'string'", false, 'string' > 'string' ); - array[item++] = new TestCase( SECTION, "'astring' > 'string'", false, 'astring' > 'string' ); - array[item++] = new TestCase( SECTION, "'strings' > 'stringy'", false, 'strings' > 'stringy' ); - array[item++] = new TestCase( SECTION, "'strings' > 'stringier'", true, 'strings' > 'stringier' ); - array[item++] = new TestCase( SECTION, "'string' > 'astring'", true, 'string' > 'astring' ); - array[item++] = new TestCase( SECTION, "'string' > 'strings'", false, 'string' > 'strings' ); - - - return ( array ); -} -function MyObject(value) { - this.value = value; - this.valueOf = new Function( "return this.value" ); - this.toString = new Function( "return this.value +''" ); -} -function MyValueObject(value) { - this.value = value; - this.valueOf = new Function( "return this.value" ); -} -function MyStringObject(value) { - this.value = value; - this.toString = new Function( "return this.value +''" ); -}
\ No newline at end of file diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.9.1.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.9.1.js deleted file mode 100644 index b64df9a..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.9.1.js +++ /dev/null @@ -1,162 +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: 11.9.1.js - ECMA Section: 11.9.1 The equals operator ( == ) - Description: - - The production EqualityExpression: - EqualityExpression == RelationalExpression is evaluated as follows: - - 1. Evaluate EqualityExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate RelationalExpression. - 4. Call GetValue(Result(3)). - 5. Perform the comparison Result(4) == Result(2). (See section 11.9.3) - 6. Return Result(5). - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.9.1"; - var VERSION = "ECMA_1"; - startTest(); - var BUGNUMBER="77391"; - - - var testcases = getTestCases(); - - writeHeaderToLog( SECTION + " The equals operator ( == )"); - 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(); - var item = 0; - - // type x and type y are the same. if type x is undefined or null, return true - - array[item++] = new TestCase( SECTION, "void 0 = void 0", true, void 0 == void 0 ); - array[item++] = new TestCase( SECTION, "null == null", true, null == null ); - - // if x is NaN, return false. if y is NaN, return false. - - array[item++] = new TestCase( SECTION, "NaN == NaN", false, Number.NaN == Number.NaN ); - array[item++] = new TestCase( SECTION, "NaN == 0", false, Number.NaN == 0 ); - array[item++] = new TestCase( SECTION, "0 == NaN", false, 0 == Number.NaN ); - array[item++] = new TestCase( SECTION, "NaN == Infinity", false, Number.NaN == Number.POSITIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "Infinity == NaN", false, Number.POSITIVE_INFINITY == Number.NaN ); - - // if x is the same number value as y, return true. - - array[item++] = new TestCase( SECTION, "Number.MAX_VALUE == Number.MAX_VALUE", true, Number.MAX_VALUE == Number.MAX_VALUE ); - array[item++] = new TestCase( SECTION, "Number.MIN_VALUE == Number.MIN_VALUE", true, Number.MIN_VALUE == Number.MIN_VALUE ); - array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY == Number.POSITIVE_INFINITY", true, Number.POSITIVE_INFINITY == Number.POSITIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY == Number.NEGATIVE_INFINITY", true, Number.NEGATIVE_INFINITY == Number.NEGATIVE_INFINITY ); - - // if xis 0 and y is -0, return true. if x is -0 and y is 0, return true. - - array[item++] = new TestCase( SECTION, "0 == 0", true, 0 == 0 ); - array[item++] = new TestCase( SECTION, "0 == -0", true, 0 == -0 ); - array[item++] = new TestCase( SECTION, "-0 == 0", true, -0 == 0 ); - array[item++] = new TestCase( SECTION, "-0 == -0", true, -0 == -0 ); - - // return false. - - array[item++] = new TestCase( SECTION, "0.9 == 1", false, 0.9 == 1 ); - array[item++] = new TestCase( SECTION, "0.999999 == 1", false, 0.999999 == 1 ); - array[item++] = new TestCase( SECTION, "0.9999999999 == 1", false, 0.9999999999 == 1 ); - array[item++] = new TestCase( SECTION, "0.9999999999999 == 1", false, 0.9999999999999 == 1 ); - - // type x and type y are the same type, but not numbers. - - - // x and y are strings. return true if x and y are exactly the same sequence of characters. - // otherwise, return false. - - array[item++] = new TestCase( SECTION, "'hello' == 'hello'", true, "hello" == "hello" ); - - // x and y are booleans. return true if both are true or both are false. - - array[item++] = new TestCase( SECTION, "true == true", true, true == true ); - array[item++] = new TestCase( SECTION, "false == false", true, false == false ); - array[item++] = new TestCase( SECTION, "true == false", false, true == false ); - array[item++] = new TestCase( SECTION, "false == true", false, false == true ); - - // return true if x and y refer to the same object. otherwise return false. - - array[item++] = new TestCase( SECTION, "new MyObject(true) == new MyObject(true)", false, new MyObject(true) == new MyObject(true) ); - array[item++] = new TestCase( SECTION, "new Boolean(true) == new Boolean(true)", false, new Boolean(true) == new Boolean(true) ); - array[item++] = new TestCase( SECTION, "new Boolean(false) == new Boolean(false)", false, new Boolean(false) == new Boolean(false) ); - - - array[item++] = new TestCase( SECTION, "x = new MyObject(true); y = x; z = x; z == y", true, eval("x = new MyObject(true); y = x; z = x; z == y") ); - array[item++] = new TestCase( SECTION, "x = new MyObject(false); y = x; z = x; z == y", true, eval("x = new MyObject(false); y = x; z = x; z == y") ); - array[item++] = new TestCase( SECTION, "x = new Boolean(true); y = x; z = x; z == y", true, eval("x = new Boolean(true); y = x; z = x; z == y") ); - array[item++] = new TestCase( SECTION, "x = new Boolean(false); y = x; z = x; z == y", true, eval("x = new Boolean(false); y = x; z = x; z == y") ); - - array[item++] = new TestCase( SECTION, "new Boolean(true) == new Boolean(true)", false, new Boolean(true) == new Boolean(true) ); - array[item++] = new TestCase( SECTION, "new Boolean(false) == new Boolean(false)", false, new Boolean(false) == new Boolean(false) ); - - // if x is null and y is undefined, return true. if x is undefined and y is null return true. - - array[item++] = new TestCase( SECTION, "null == void 0", true, null == void 0 ); - array[item++] = new TestCase( SECTION, "void 0 == null", true, void 0 == null ); - - // if type(x) is Number and type(y) is string, return the result of the comparison x == ToNumber(y). - - array[item++] = new TestCase( SECTION, "1 == '1'", true, 1 == '1' ); - array[item++] = new TestCase( SECTION, "255 == '0xff'", true, 255 == '0xff' ); - array[item++] = new TestCase( SECTION, "0 == '\r'", true, 0 == "\r" ); - array[item++] = new TestCase( SECTION, "1e19 == '1e19'", true, 1e19 == "1e19" ); - - - array[item++] = new TestCase( SECTION, "new Boolean(true) == true", true, true == new Boolean(true) ); - array[item++] = new TestCase( SECTION, "new MyObject(true) == true", true, true == new MyObject(true) ); - - array[item++] = new TestCase( SECTION, "new Boolean(false) == false", true, new Boolean(false) == false ); - array[item++] = new TestCase( SECTION, "new MyObject(false) == false", true, new MyObject(false) == false ); - - array[item++] = new TestCase( SECTION, "true == new Boolean(true)", true, true == new Boolean(true) ); - array[item++] = new TestCase( SECTION, "true == new MyObject(true)", true, true == new MyObject(true) ); - - array[item++] = new TestCase( SECTION, "false == new Boolean(false)", true, false == new Boolean(false) ); - array[item++] = new TestCase( SECTION, "false == new MyObject(false)", true, false == new MyObject(false) ); - - return ( array ); -} - -function MyObject( value ) { - this.value = value; - this.valueOf = new Function( "return this.value" ); -}
\ No newline at end of file diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.9.2.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.9.2.js deleted file mode 100644 index 9eb4bfc..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.9.2.js +++ /dev/null @@ -1,161 +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: 11.9.2.js - ECMA Section: 11.9.2 The equals operator ( == ) - Description: - - The production EqualityExpression: - EqualityExpression == RelationalExpression is evaluated as follows: - - 1. Evaluate EqualityExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate RelationalExpression. - 4. Call GetValue(Result(3)). - 5. Perform the comparison Result(4) == Result(2). (See section 11.9.3) - 6. Return Result(5). - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.9.2"; - var VERSION = "ECMA_1"; - startTest(); - var BUGNUMBER="77391"; - - var testcases = getTestCases(); - - writeHeaderToLog( SECTION + " The equals operator ( == )"); - 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(); - var item = 0; - - // type x and type y are the same. if type x is undefined or null, return true - - array[item++] = new TestCase( SECTION, "void 0 == void 0", false, void 0 != void 0 ); - array[item++] = new TestCase( SECTION, "null == null", false, null != null ); - - // if x is NaN, return false. if y is NaN, return false. - - array[item++] = new TestCase( SECTION, "NaN != NaN", true, Number.NaN != Number.NaN ); - array[item++] = new TestCase( SECTION, "NaN != 0", true, Number.NaN != 0 ); - array[item++] = new TestCase( SECTION, "0 != NaN", true, 0 != Number.NaN ); - array[item++] = new TestCase( SECTION, "NaN != Infinity", true, Number.NaN != Number.POSITIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "Infinity != NaN", true, Number.POSITIVE_INFINITY != Number.NaN ); - - // if x is the same number value as y, return true. - - array[item++] = new TestCase( SECTION, "Number.MAX_VALUE != Number.MAX_VALUE", false, Number.MAX_VALUE != Number.MAX_VALUE ); - array[item++] = new TestCase( SECTION, "Number.MIN_VALUE != Number.MIN_VALUE", false, Number.MIN_VALUE != Number.MIN_VALUE ); - array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY != Number.POSITIVE_INFINITY", false, Number.POSITIVE_INFINITY != Number.POSITIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY != Number.NEGATIVE_INFINITY", false, Number.NEGATIVE_INFINITY != Number.NEGATIVE_INFINITY ); - - // if xis 0 and y is -0, return true. if x is -0 and y is 0, return true. - - array[item++] = new TestCase( SECTION, "0 != 0", false, 0 != 0 ); - array[item++] = new TestCase( SECTION, "0 != -0", false, 0 != -0 ); - array[item++] = new TestCase( SECTION, "-0 != 0", false, -0 != 0 ); - array[item++] = new TestCase( SECTION, "-0 != -0", false, -0 != -0 ); - - // return false. - - array[item++] = new TestCase( SECTION, "0.9 != 1", true, 0.9 != 1 ); - array[item++] = new TestCase( SECTION, "0.999999 != 1", true, 0.999999 != 1 ); - array[item++] = new TestCase( SECTION, "0.9999999999 != 1", true, 0.9999999999 != 1 ); - array[item++] = new TestCase( SECTION, "0.9999999999999 != 1", true, 0.9999999999999 != 1 ); - - // type x and type y are the same type, but not numbers. - - - // x and y are strings. return true if x and y are exactly the same sequence of characters. - // otherwise, return false. - - array[item++] = new TestCase( SECTION, "'hello' != 'hello'", false, "hello" != "hello" ); - - // x and y are booleans. return true if both are true or both are false. - - array[item++] = new TestCase( SECTION, "true != true", false, true != true ); - array[item++] = new TestCase( SECTION, "false != false", false, false != false ); - array[item++] = new TestCase( SECTION, "true != false", true, true != false ); - array[item++] = new TestCase( SECTION, "false != true", true, false != true ); - - // return true if x and y refer to the same object. otherwise return false. - - array[item++] = new TestCase( SECTION, "new MyObject(true) != new MyObject(true)", true, new MyObject(true) != new MyObject(true) ); - array[item++] = new TestCase( SECTION, "new Boolean(true) != new Boolean(true)", true, new Boolean(true) != new Boolean(true) ); - array[item++] = new TestCase( SECTION, "new Boolean(false) != new Boolean(false)", true, new Boolean(false) != new Boolean(false) ); - - - array[item++] = new TestCase( SECTION, "x = new MyObject(true); y = x; z = x; z != y", false, eval("x = new MyObject(true); y = x; z = x; z != y") ); - array[item++] = new TestCase( SECTION, "x = new MyObject(false); y = x; z = x; z != y", false, eval("x = new MyObject(false); y = x; z = x; z != y") ); - array[item++] = new TestCase( SECTION, "x = new Boolean(true); y = x; z = x; z != y", false, eval("x = new Boolean(true); y = x; z = x; z != y") ); - array[item++] = new TestCase( SECTION, "x = new Boolean(false); y = x; z = x; z != y", false, eval("x = new Boolean(false); y = x; z = x; z != y") ); - - array[item++] = new TestCase( SECTION, "new Boolean(true) != new Boolean(true)", true, new Boolean(true) != new Boolean(true) ); - array[item++] = new TestCase( SECTION, "new Boolean(false) != new Boolean(false)", true, new Boolean(false) != new Boolean(false) ); - - // if x is null and y is undefined, return true. if x is undefined and y is null return true. - - array[item++] = new TestCase( SECTION, "null != void 0", false, null != void 0 ); - array[item++] = new TestCase( SECTION, "void 0 != null", false, void 0 != null ); - - // if type(x) is Number and type(y) is string, return the result of the comparison x != ToNumber(y). - - array[item++] = new TestCase( SECTION, "1 != '1'", false, 1 != '1' ); - array[item++] = new TestCase( SECTION, "255 != '0xff'", false, 255 != '0xff' ); - array[item++] = new TestCase( SECTION, "0 != '\r'", false, 0 != "\r" ); - array[item++] = new TestCase( SECTION, "1e19 != '1e19'", false, 1e19 != "1e19" ); - - - array[item++] = new TestCase( SECTION, "new Boolean(true) != true", false, true != new Boolean(true) ); - array[item++] = new TestCase( SECTION, "new MyObject(true) != true", false, true != new MyObject(true) ); - - array[item++] = new TestCase( SECTION, "new Boolean(false) != false", false, new Boolean(false) != false ); - array[item++] = new TestCase( SECTION, "new MyObject(false) != false", false, new MyObject(false) != false ); - - array[item++] = new TestCase( SECTION, "true != new Boolean(true)", false, true != new Boolean(true) ); - array[item++] = new TestCase( SECTION, "true != new MyObject(true)", false, true != new MyObject(true) ); - - array[item++] = new TestCase( SECTION, "false != new Boolean(false)", false, false != new Boolean(false) ); - array[item++] = new TestCase( SECTION, "false != new MyObject(false)", false, false != new MyObject(false) ); - - return ( array ); -} - -function MyObject( value ) { - this.value = value; - this.valueOf = new Function( "return this.value" ); -}
\ No newline at end of file diff --git a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.9.3.js b/JavaScriptCore/tests/mozilla/ecma/Expressions/11.9.3.js deleted file mode 100644 index 134060b..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/Expressions/11.9.3.js +++ /dev/null @@ -1,161 +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: 11.9.3.js - ECMA Section: 11.9.3 The equals operator ( == ) - Description: - - The production EqualityExpression: - EqualityExpression == RelationalExpression is evaluated as follows: - - 1. Evaluate EqualityExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate RelationalExpression. - 4. Call GetValue(Result(3)). - 5. Perform the comparison Result(4) == Result(2). (See section 11.9.3) - 6. Return Result(5). - Author: christine@netscape.com - Date: 12 november 1997 -*/ - var SECTION = "11.9.3"; - var VERSION = "ECMA_1"; - startTest(); - var BUGNUMBER="77391"; - - var testcases = getTestCases(); - - writeHeaderToLog( SECTION + " The equals operator ( == )"); - 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(); - var item = 0; - - // type x and type y are the same. if type x is undefined or null, return true - - array[item++] = new TestCase( SECTION, "void 0 = void 0", true, void 0 == void 0 ); - array[item++] = new TestCase( SECTION, "null == null", true, null == null ); - - // if x is NaN, return false. if y is NaN, return false. - - array[item++] = new TestCase( SECTION, "NaN == NaN", false, Number.NaN == Number.NaN ); - array[item++] = new TestCase( SECTION, "NaN == 0", false, Number.NaN == 0 ); - array[item++] = new TestCase( SECTION, "0 == NaN", false, 0 == Number.NaN ); - array[item++] = new TestCase( SECTION, "NaN == Infinity", false, Number.NaN == Number.POSITIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "Infinity == NaN", false, Number.POSITIVE_INFINITY == Number.NaN ); - - // if x is the same number value as y, return true. - - array[item++] = new TestCase( SECTION, "Number.MAX_VALUE == Number.MAX_VALUE", true, Number.MAX_VALUE == Number.MAX_VALUE ); - array[item++] = new TestCase( SECTION, "Number.MIN_VALUE == Number.MIN_VALUE", true, Number.MIN_VALUE == Number.MIN_VALUE ); - array[item++] = new TestCase( SECTION, "Number.POSITIVE_INFINITY == Number.POSITIVE_INFINITY", true, Number.POSITIVE_INFINITY == Number.POSITIVE_INFINITY ); - array[item++] = new TestCase( SECTION, "Number.NEGATIVE_INFINITY == Number.NEGATIVE_INFINITY", true, Number.NEGATIVE_INFINITY == Number.NEGATIVE_INFINITY ); - - // if xis 0 and y is -0, return true. if x is -0 and y is 0, return true. - - array[item++] = new TestCase( SECTION, "0 == 0", true, 0 == 0 ); - array[item++] = new TestCase( SECTION, "0 == -0", true, 0 == -0 ); - array[item++] = new TestCase( SECTION, "-0 == 0", true, -0 == 0 ); - array[item++] = new TestCase( SECTION, "-0 == -0", true, -0 == -0 ); - - // return false. - - array[item++] = new TestCase( SECTION, "0.9 == 1", false, 0.9 == 1 ); - array[item++] = new TestCase( SECTION, "0.999999 == 1", false, 0.999999 == 1 ); - array[item++] = new TestCase( SECTION, "0.9999999999 == 1", false, 0.9999999999 == 1 ); - array[item++] = new TestCase( SECTION, "0.9999999999999 == 1", false, 0.9999999999999 == 1 ); - - // type x and type y are the same type, but not numbers. - - - // x and y are strings. return true if x and y are exactly the same sequence of characters. - // otherwise, return false. - - array[item++] = new TestCase( SECTION, "'hello' == 'hello'", true, "hello" == "hello" ); - - // x and y are booleans. return true if both are true or both are false. - - array[item++] = new TestCase( SECTION, "true == true", true, true == true ); - array[item++] = new TestCase( SECTION, "false == false", true, false == false ); - array[item++] = new TestCase( SECTION, "true == false", false, true == false ); - array[item++] = new TestCase( SECTION, "false == true", false, false == true ); - - // return true if x and y refer to the same object. otherwise return false. - - array[item++] = new TestCase( SECTION, "new MyObject(true) == new MyObject(true)", false, new MyObject(true) == new MyObject(true) ); - array[item++] = new TestCase( SECTION, "new Boolean(true) == new Boolean(true)", false, new Boolean(true) == new Boolean(true) ); - array[item++] = new TestCase( SECTION, "new Boolean(false) == new Boolean(false)", false, new Boolean(false) == new Boolean(false) ); - - - array[item++] = new TestCase( SECTION, "x = new MyObject(true); y = x; z = x; z == y", true, eval("x = new MyObject(true); y = x; z = x; z == y") ); - array[item++] = new TestCase( SECTION, "x = new MyObject(false); y = x; z = x; z == y", true, eval("x = new MyObject(false); y = x; z = x; z == y") ); - array[item++] = new TestCase( SECTION, "x = new Boolean(true); y = x; z = x; z == y", true, eval("x = new Boolean(true); y = x; z = x; z == y") ); - array[item++] = new TestCase( SECTION, "x = new Boolean(false); y = x; z = x; z == y", true, eval("x = new Boolean(false); y = x; z = x; z == y") ); - - array[item++] = new TestCase( SECTION, "new Boolean(true) == new Boolean(true)", false, new Boolean(true) == new Boolean(true) ); - array[item++] = new TestCase( SECTION, "new Boolean(false) == new Boolean(false)", false, new Boolean(false) == new Boolean(false) ); - - // if x is null and y is undefined, return true. if x is undefined and y is null return true. - - array[item++] = new TestCase( SECTION, "null == void 0", true, null == void 0 ); - array[item++] = new TestCase( SECTION, "void 0 == null", true, void 0 == null ); - - // if type(x) is Number and type(y) is string, return the result of the comparison x == ToNumber(y). - - array[item++] = new TestCase( SECTION, "1 == '1'", true, 1 == '1' ); - array[item++] = new TestCase( SECTION, "255 == '0xff'", true, 255 == '0xff' ); - array[item++] = new TestCase( SECTION, "0 == '\r'", true, 0 == "\r" ); - array[item++] = new TestCase( SECTION, "1e19 == '1e19'", true, 1e19 == "1e19" ); - - - array[item++] = new TestCase( SECTION, "new Boolean(true) == true", true, true == new Boolean(true) ); - array[item++] = new TestCase( SECTION, "new MyObject(true) == true", true, true == new MyObject(true) ); - - array[item++] = new TestCase( SECTION, "new Boolean(false) == false", true, new Boolean(false) == false ); - array[item++] = new TestCase( SECTION, "new MyObject(false) == false", true, new MyObject(false) == false ); - - array[item++] = new TestCase( SECTION, "true == new Boolean(true)", true, true == new Boolean(true) ); - array[item++] = new TestCase( SECTION, "true == new MyObject(true)", true, true == new MyObject(true) ); - - array[item++] = new TestCase( SECTION, "false == new Boolean(false)", true, false == new Boolean(false) ); - array[item++] = new TestCase( SECTION, "false == new MyObject(false)", true, false == new MyObject(false) ); - - return ( array ); -} - -function MyObject( value ) { - this.value = value; - this.valueOf = new Function( "return this.value" ); -}
\ No newline at end of file |