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/ObjectObjects | |
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/ObjectObjects')
14 files changed, 0 insertions, 1232 deletions
diff --git a/JavaScriptCore/tests/mozilla/ecma/ObjectObjects/15.2.1.1.js b/JavaScriptCore/tests/mozilla/ecma/ObjectObjects/15.2.1.1.js deleted file mode 100644 index cbc1783..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/ObjectObjects/15.2.1.1.js +++ /dev/null @@ -1,151 +0,0 @@ -/* The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is Mozilla Communicator client code, released March - * 31, 1998. - * - * The Initial Developer of the Original Code is Netscape Communications - * Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - */ -/** - File Name: 15.2.1.1.js - ECMA Section: 15.2.1.1 The Object Constructor Called as a Function: - Object(value) - Description: When Object is called as a function rather than as a - constructor, the following steps are taken: - - 1. If value is null or undefined, create and return a - new object with no properties other than internal - properties exactly as if the object constructor - had been called on that same value (15.2.2.1). - 2. Return ToObject (value), whose rules are: - - undefined generate a runtime error - null generate a runtime error - boolean create a new Boolean object whose default - value is the value of the boolean. - number Create a new Number object whose default - value is the value of the number. - string Create a new String object whose default - value is the value of the string. - object Return the input argument (no conversion). - - Author: christine@netscape.com - Date: 17 july 1997 -*/ - - var SECTION = "15.2.1.1"; - var VERSION = "ECMA_1"; - startTest(); - var TITLE = "Object( value )"; - - writeHeaderToLog( SECTION + " "+ TITLE); - - var testcases = getTestCases(); - test(); - -function getTestCases() { - var array = new Array(); - var item = 0; - - var NULL_OBJECT = Object(null); - - array[item++] = new TestCase( SECTION, "Object(null).valueOf()", NULL_OBJECT, (NULL_OBJECT).valueOf() ); - array[item++] = new TestCase( SECTION, "typeof Object(null)", "object", typeof (Object(null)) ); - array[item++] = new TestCase( SECTION, "Object(null).__proto__", Object.prototype, (Object(null)).__proto__ ); - - var UNDEFINED_OBJECT = Object( void 0 ); - - array[item++] = new TestCase( SECTION, "Object(void 0).valueOf()", UNDEFINED_OBJECT, (UNDEFINED_OBJECT).valueOf() ); - array[item++] = new TestCase( SECTION, "typeof Object(void 0)", "object", typeof (Object(void 0)) ); - array[item++] = new TestCase( SECTION, "Object(void 0).__proto__", Object.prototype, (Object(void 0)).__proto__ ); - - array[item++] = new TestCase( SECTION, "Object(true).valueOf()", true, (Object(true)).valueOf() ); - array[item++] = new TestCase( SECTION, "typeof Object(true)", "object", typeof Object(true) ); - array[item++] = new TestCase( SECTION, "var MYOB = Object(true); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Boolean]", eval("var MYOB = Object(true); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - - array[item++] = new TestCase( SECTION, "Object(false).valueOf()", false, (Object(false)).valueOf() ); - array[item++] = new TestCase( SECTION, "typeof Object(false)", "object", typeof Object(false) ); - array[item++] = new TestCase( SECTION, "var MYOB = Object(false); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Boolean]", eval("var MYOB = Object(false); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - - array[item++] = new TestCase( SECTION, "Object(0).valueOf()", 0, (Object(0)).valueOf() ); - array[item++] = new TestCase( SECTION, "typeof Object(0)", "object", typeof Object(0) ); - array[item++] = new TestCase( SECTION, "var MYOB = Object(0); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Number]", eval("var MYOB = Object(0); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - - array[item++] = new TestCase( SECTION, "Object(-0).valueOf()", -0, (Object(-0)).valueOf() ); - array[item++] = new TestCase( SECTION, "typeof Object(-0)", "object", typeof Object(-0) ); - array[item++] = new TestCase( SECTION, "var MYOB = Object(-0); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Number]", eval("var MYOB = Object(-0); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - - array[item++] = new TestCase( SECTION, "Object(1).valueOf()", 1, (Object(1)).valueOf() ); - array[item++] = new TestCase( SECTION, "typeof Object(1)", "object", typeof Object(1) ); - array[item++] = new TestCase( SECTION, "var MYOB = Object(1); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Number]", eval("var MYOB = Object(1); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - - array[item++] = new TestCase( SECTION, "Object(-1).valueOf()", -1, (Object(-1)).valueOf() ); - array[item++] = new TestCase( SECTION, "typeof Object(-1)", "object", typeof Object(-1) ); - array[item++] = new TestCase( SECTION, "var MYOB = Object(-1); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Number]", eval("var MYOB = Object(-1); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - - array[item++] = new TestCase( SECTION, "Object(Number.MAX_VALUE).valueOf()", 1.7976931348623157e308, (Object(Number.MAX_VALUE)).valueOf() ); - array[item++] = new TestCase( SECTION, "typeof Object(Number.MAX_VALUE)", "object", typeof Object(Number.MAX_VALUE) ); - array[item++] = new TestCase( SECTION, "var MYOB = Object(Number.MAX_VALUE); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Number]", eval("var MYOB = Object(Number.MAX_VALUE); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - - array[item++] = new TestCase( SECTION, "Object(Number.MIN_VALUE).valueOf()", 5e-324, (Object(Number.MIN_VALUE)).valueOf() ); - array[item++] = new TestCase( SECTION, "typeof Object(Number.MIN_VALUE)", "object", typeof Object(Number.MIN_VALUE) ); - array[item++] = new TestCase( SECTION, "var MYOB = Object(Number.MIN_VALUE); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Number]", eval("var MYOB = Object(Number.MIN_VALUE); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - - array[item++] = new TestCase( SECTION, "Object(Number.POSITIVE_INFINITY).valueOf()", Number.POSITIVE_INFINITY, (Object(Number.POSITIVE_INFINITY)).valueOf() ); - array[item++] = new TestCase( SECTION, "typeof Object(Number.POSITIVE_INFINITY)", "object", typeof Object(Number.POSITIVE_INFINITY) ); - array[item++] = new TestCase( SECTION, "var MYOB = Object(Number.POSITIVE_INFINITY); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Number]", eval("var MYOB = Object(Number.POSITIVE_INFINITY); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - - array[item++] = new TestCase( SECTION, "Object(Number.NEGATIVE_INFINITY).valueOf()", Number.NEGATIVE_INFINITY, (Object(Number.NEGATIVE_INFINITY)).valueOf() ); - array[item++] = new TestCase( SECTION, "typeof Object(Number.NEGATIVE_INFINITY)", "object", typeof Object(Number.NEGATIVE_INFINITY) ); - array[item++] = new TestCase( SECTION, "var MYOB = Object(Number.NEGATIVE_INFINITY); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Number]", eval("var MYOB = Object(Number.NEGATIVE_INFINITY); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - - array[item++] = new TestCase( SECTION, "Object(Number.NaN).valueOf()", Number.NaN, (Object(Number.NaN)).valueOf() ); - array[item++] = new TestCase( SECTION, "typeof Object(Number.NaN)", "object", typeof Object(Number.NaN) ); - array[item++] = new TestCase( SECTION, "var MYOB = Object(Number.NaN); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Number]", eval("var MYOB = Object(Number.NaN); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - - array[item++] = new TestCase( SECTION, "Object('a string').valueOf()", "a string", (Object("a string")).valueOf() ); - array[item++] = new TestCase( SECTION, "typeof Object('a string')", "object", typeof (Object("a string")) ); - array[item++] = new TestCase( SECTION, "var MYOB = Object('a string'); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object String]", eval("var MYOB = Object('a string'); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - - array[item++] = new TestCase( SECTION, "Object('').valueOf()", "", (Object("")).valueOf() ); - array[item++] = new TestCase( SECTION, "typeof Object('')", "object", typeof (Object("")) ); - array[item++] = new TestCase( SECTION, "var MYOB = Object(''); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object String]", eval("var MYOB = Object(''); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - - array[item++] = new TestCase( SECTION, "Object('\\r\\t\\b\\n\\v\\f').valueOf()", "\r\t\b\n\v\f", (Object("\r\t\b\n\v\f")).valueOf() ); - array[item++] = new TestCase( SECTION, "typeof Object('\\r\\t\\b\\n\\v\\f')", "object", typeof (Object("\\r\\t\\b\\n\\v\\f")) ); - array[item++] = new TestCase( SECTION, "var MYOB = Object('\\r\\t\\b\\n\\v\\f'); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object String]", eval("var MYOB = Object('\\r\\t\\b\\n\\v\\f'); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - - array[item++] = new TestCase( SECTION, "Object( '\\\'\\\"\\' ).valueOf()", "\'\"\\", (Object("\'\"\\")).valueOf() ); - array[item++] = new TestCase( SECTION, "typeof Object( '\\\'\\\"\\' )", "object", typeof Object("\'\"\\") ); -// array[item++] = new TestCase( SECTION, "var MYOB = Object( '\\\'\\\"\\' ); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object String]", eval("var MYOB = Object( '\\\'\\\"\\' ); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - - return ( array ); -} - -function test() { - for ( tc = 0; tc < testcases.length; tc++ ) { - testcases[tc].passed = writeTestCaseResult( - testcases[tc].expect, - testcases[tc].actual, - testcases[tc].description +" = "+ - testcases[tc].actual ); - - testcases[tc].reason += - ( testcases[tc].passed ) ? "" : "wrong value "; - } - stopTest(); - return ( testcases ); -} diff --git a/JavaScriptCore/tests/mozilla/ecma/ObjectObjects/15.2.1.2.js b/JavaScriptCore/tests/mozilla/ecma/ObjectObjects/15.2.1.2.js deleted file mode 100644 index 6a619b6..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/ObjectObjects/15.2.1.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: 15.2.1.2.js - ECMA Section: 15.2.1.2 The Object Constructor Called as a Function: - Object(value) - Description: When Object is called as a function rather than as a - constructor, the following steps are taken: - - 1. If value is null or undefined, create and return a - new object with no proerties other than internal - properties exactly as if the object constructor - had been called on that same value (15.2.2.1). - 2. Return ToObject (value), whose rules are: - - undefined generate a runtime error - null generate a runtime error - boolean create a new Boolean object whose default - value is the value of the boolean. - number Create a new Number object whose default - value is the value of the number. - string Create a new String object whose default - value is the value of the string. - object Return the input argument (no conversion). - - Author: christine@netscape.com - Date: 17 july 1997 -*/ - - var SECTION = "15.2.1.2"; - var VERSION = "ECMA_1"; - startTest(); - var TITLE = "Object()"; - - writeHeaderToLog( SECTION + " "+ TITLE); - - var testcases = getTestCases(); - test(); - -function getTestCases() { - var array = new Array(); - var item = 0; - - var MYOB = Object(); - - array[item++] = new TestCase( SECTION, "var MYOB = Object(); MYOB.valueOf()", MYOB, MYOB.valueOf() ); - array[item++] = new TestCase( SECTION, "typeof Object()", "object", typeof (Object(null)) ); - array[item++] = new TestCase( SECTION, "var MYOB = Object(); MYOB.toString()", "[object Object]", eval("var MYOB = Object(); MYOB.toString()") ); - - return ( array ); -} - -function test() { - for ( tc = 0; tc < testcases.length; tc++ ) { - testcases[tc].passed = writeTestCaseResult( - testcases[tc].expect, - testcases[tc].actual, - testcases[tc].description +" = "+ - testcases[tc].actual ); - - testcases[tc].reason += - ( testcases[tc].passed ) ? "" : "wrong value "; - } - stopTest(); - return ( testcases ); -} diff --git a/JavaScriptCore/tests/mozilla/ecma/ObjectObjects/15.2.2.1.js b/JavaScriptCore/tests/mozilla/ecma/ObjectObjects/15.2.2.1.js deleted file mode 100644 index cf04ce4..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/ObjectObjects/15.2.2.1.js +++ /dev/null @@ -1,139 +0,0 @@ -/* The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is Mozilla Communicator client code, released March - * 31, 1998. - * - * The Initial Developer of the Original Code is Netscape Communications - * Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - */ -/** - File Name: 15.2.2.1.js - ECMA Section: 15.2.2.1 The Object Constructor: new Object( value ) - - 1.If the type of the value is not Object, go to step 4. - 2.If the value is a native ECMAScript object, do not create a new object; simply return value. - 3.If the value is a host object, then actions are taken and a result is returned in an - implementation-dependent manner that may depend on the host object. - 4.If the type of the value is String, return ToObject(value). - 5.If the type of the value is Boolean, return ToObject(value). - 6.If the type of the value is Number, return ToObject(value). - 7.(The type of the value must be Null or Undefined.) Create a new native ECMAScript object. - The [[Prototype]] property of the newly constructed object is set to the Object prototype object. - The [[Class]] property of the newly constructed object is set to "Object". - The newly constructed object has no [[Value]] property. - Return the newly created native object. - - Description: This does not test cases where the object is a host object. - Author: christine@netscape.com - Date: 7 october 1997 -*/ - - var SECTION = "15.2.2.1"; - var VERSION = "ECMA_1"; - startTest(); - var TITLE = "new Object( value )"; - - writeHeaderToLog( SECTION + " "+ TITLE); - - var testcases = getTestCases(); - test(); - -function getTestCases() { - var array = new Array(); - var item = 0; - - array[item++] = new TestCase( SECTION, "typeof new Object(null)", "object", typeof new Object(null) ); - array[item++] = new TestCase( SECTION, "MYOB = new Object(null); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Object]", eval("MYOB = new Object(null); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - - array[item++] = new TestCase( SECTION, "typeof new Object(void 0)", "object", typeof new Object(void 0) ); - array[item++] = new TestCase( SECTION, "MYOB = new Object(new Object(void 0)); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Object]", eval("MYOB = new Object(new Object(void 0)); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - - array[item++] = new TestCase( SECTION, "typeof new Object('string')", "object", typeof new Object('string') ); - array[item++] = new TestCase( SECTION, "MYOB = (new Object('string'); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object String]", eval("MYOB = new Object('string'); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - array[item++] = new TestCase( SECTION, "(new Object('string').valueOf()", "string", (new Object('string')).valueOf() ); - - array[item++] = new TestCase( SECTION, "typeof new Object('')", "object", typeof new Object('') ); - array[item++] = new TestCase( SECTION, "MYOB = (new Object(''); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object String]", eval("MYOB = new Object(''); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - array[item++] = new TestCase( SECTION, "(new Object('').valueOf()", "", (new Object('')).valueOf() ); - - array[item++] = new TestCase( SECTION, "typeof new Object(Number.NaN)", "object", typeof new Object(Number.NaN) ); - array[item++] = new TestCase( SECTION, "MYOB = (new Object(Number.NaN); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Number]", eval("MYOB = new Object(Number.NaN); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - array[item++] = new TestCase( SECTION, "(new Object(Number.NaN).valueOf()", Number.NaN, (new Object(Number.NaN)).valueOf() ); - - array[item++] = new TestCase( SECTION, "typeof new Object(0)", "object", typeof new Object(0) ); - array[item++] = new TestCase( SECTION, "MYOB = (new Object(0); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Number]", eval("MYOB = new Object(0); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - array[item++] = new TestCase( SECTION, "(new Object(0).valueOf()", 0, (new Object(0)).valueOf() ); - - array[item++] = new TestCase( SECTION, "typeof new Object(-0)", "object", typeof new Object(-0) ); - array[item++] = new TestCase( SECTION, "MYOB = (new Object(-0); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Number]", eval("MYOB = new Object(-0); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - array[item++] = new TestCase( SECTION, "(new Object(-0).valueOf()", -0, (new Object(-0)).valueOf() ); - - array[item++] = new TestCase( SECTION, "typeof new Object(1)", "object", typeof new Object(1) ); - array[item++] = new TestCase( SECTION, "MYOB = (new Object(1); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Number]", eval("MYOB = new Object(1); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - array[item++] = new TestCase( SECTION, "(new Object(1).valueOf()", 1, (new Object(1)).valueOf() ); - - array[item++] = new TestCase( SECTION, "typeof new Object(-1)", "object", typeof new Object(-1) ); - array[item++] = new TestCase( SECTION, "MYOB = (new Object(-1); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Number]", eval("MYOB = new Object(-1); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - array[item++] = new TestCase( SECTION, "(new Object(-1).valueOf()", -1, (new Object(-1)).valueOf() ); - - array[item++] = new TestCase( SECTION, "typeof new Object(true)", "object", typeof new Object(true) ); - array[item++] = new TestCase( SECTION, "MYOB = (new Object(true); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Boolean]", eval("MYOB = new Object(true); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - array[item++] = new TestCase( SECTION, "(new Object(true).valueOf()", true, (new Object(true)).valueOf() ); - - array[item++] = new TestCase( SECTION, "typeof new Object(false)", "object", typeof new Object(false) ); - array[item++] = new TestCase( SECTION, "MYOB = (new Object(false); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Boolean]", eval("MYOB = new Object(false); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - array[item++] = new TestCase( SECTION, "(new Object(false).valueOf()", false, (new Object(false)).valueOf() ); - - array[item++] = new TestCase( SECTION, "typeof new Object(Boolean())", "object", typeof new Object(Boolean()) ); - array[item++] = new TestCase( SECTION, "MYOB = (new Object(Boolean()); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Boolean]", eval("MYOB = new Object(Boolean()); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - array[item++] = new TestCase( SECTION, "(new Object(Boolean()).valueOf()", Boolean(), (new Object(Boolean())).valueOf() ); - - - var myglobal = this; - var myobject = new Object( "my new object" ); - var myarray = new Array(); - var myboolean = new Boolean(); - var mynumber = new Number(); - var mystring = new String(); - var myobject = new Object(); - var myfunction = new Function( "x", "return x"); - var mymath = Math; - - array[item++] = new TestCase( SECTION, "myglobal = new Object( this )", myglobal, new Object(this) ); - array[item++] = new TestCase( SECTION, "myobject = new Object('my new object'); new Object(myobject)", myobject, new Object(myobject) ); - array[item++] = new TestCase( SECTION, "myarray = new Array(); new Object(myarray)", myarray, new Object(myarray) ); - array[item++] = new TestCase( SECTION, "myboolean = new Boolean(); new Object(myboolean)", myboolean, new Object(myboolean) ); - array[item++] = new TestCase( SECTION, "mynumber = new Number(); new Object(mynumber)", mynumber, new Object(mynumber) ); - array[item++] = new TestCase( SECTION, "mystring = new String9); new Object(mystring)", mystring, new Object(mystring) ); - array[item++] = new TestCase( SECTION, "myobject = new Object(); new Object(mynobject)", myobject, new Object(myobject) ); - array[item++] = new TestCase( SECTION, "myfunction = new Function(); new Object(myfunction)", myfunction, new Object(myfunction) ); - array[item++] = new TestCase( SECTION, "mymath = Math; new Object(mymath)", mymath, new Object(mymath) ); - - 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/ObjectObjects/15.2.2.2.js b/JavaScriptCore/tests/mozilla/ecma/ObjectObjects/15.2.2.2.js deleted file mode 100644 index eddedfa..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/ObjectObjects/15.2.2.2.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: 15.2.2.2.js - ECMA Section: 15.2.2.2 new Object() - Description: - - When the Object constructor is called with no argument, the following - step is taken: - - 1. Create a new native ECMAScript object. - The [[Prototype]] property of the newly constructed object is set to - the Object prototype object. - - The [[Class]] property of the newly constructed object is set - to "Object". - - The newly constructed object has no [[Value]] property. - - Return the newly created native object. - - Author: christine@netscape.com - Date: 7 october 1997 -*/ - var SECTION = "15.2.2.2"; - var VERSION = "ECMA_1"; - startTest(); - var TITLE = "new Object()"; - - writeHeaderToLog( SECTION + " "+ TITLE); - - var testcases = getTestCases(); - test(); - -function getTestCases() { - var array = new Array(); - var item = 0; - - array[item++] = new TestCase( SECTION, "typeof new Object()", "object", typeof new Object() ); - array[item++] = new TestCase( SECTION, "Object.prototype.toString()", "[object Object]", Object.prototype.toString() ); - array[item++] = new TestCase( SECTION, "(new Object()).toString()", "[object Object]", (new Object()).toString() ); - - return ( array ); -} -function test() { - for ( tc = 0; tc < testcases.length; tc++ ) { - testcases[tc].passed = writeTestCaseResult( - testcases[tc].expect, - testcases[tc].actual, - testcases[tc].description +" = "+ testcases[tc].actual ); - - testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; - } - stopTest(); - return ( testcases ); -} - -function MyObject( value ) { - this.value = value; - this.valueOf = new Function( "return this.value" ); - this.toString = new Function( "return this.value+''" ); -}
\ No newline at end of file diff --git a/JavaScriptCore/tests/mozilla/ecma/ObjectObjects/15.2.3-1.js b/JavaScriptCore/tests/mozilla/ecma/ObjectObjects/15.2.3-1.js deleted file mode 100644 index 06f50ce..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/ObjectObjects/15.2.3-1.js +++ /dev/null @@ -1,65 +0,0 @@ -/* The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is Mozilla Communicator client code, released March - * 31, 1998. - * - * The Initial Developer of the Original Code is Netscape Communications - * Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - */ -/** - File Name: 15.2.3-1.js - ECMA Section: 15.2.3 Properties of the Object Constructor - - Description: The value of the internal [[Prototype]] property of the - Object constructor is the Function prototype object. - - Besides the call and construct propreties and the length - property, the Object constructor has properties described - in 15.2.3.1. - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ - var SECTION = "15.2.3"; - var VERSION = "ECMA_2"; - startTest(); - var testcases = getTestCases(); - - writeHeaderToLog( SECTION + " Properties of the Object Constructor"); - test(); - -function getTestCases() { - var array = new Array(); - var item = 0; - - array[item++] = new TestCase( SECTION, "Object.__proto__", Function.prototype, Object.__proto__ ); - array[item++] = new TestCase( SECTION, "Object.length", 1, Object.length ); - - return ( array ); -} -function test( array ) { - for ( tc=0; tc < testcases.length; tc++ ) { - testcases[tc].actual = eval( testcases[tc].actual ); - 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/ObjectObjects/15.2.3.1-1.js b/JavaScriptCore/tests/mozilla/ecma/ObjectObjects/15.2.3.1-1.js deleted file mode 100644 index ee0539a..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/ObjectObjects/15.2.3.1-1.js +++ /dev/null @@ -1,68 +0,0 @@ -/* The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is Mozilla Communicator client code, released March - * 31, 1998. - * - * The Initial Developer of the Original Code is Netscape Communications - * Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - */ -/** - File Name: 15.2.3.1-1.js - ECMA Section: 15.2.3.1 Object.prototype - - Description: The initial value of Object.prototype is the built-in - Object prototype object. - - This property shall have the attributes [ DontEnum, - DontDelete ReadOnly ] - - This tests the [DontEnum] property of Object.prototype - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ - var SECTION = "15.2.3.1-1"; - var VERSION = "ECMA_1"; - startTest(); - var TITLE = "Object.prototype"; - - writeHeaderToLog( SECTION + " "+ TITLE); - - var testcases = getTestCases(); - test(); - -function getTestCases() { - var array = new Array(); - var item = 0; - array[item++] = new TestCase( SECTION, "var str = '';for ( p in Object ) { str += p; }; str", - "", - eval( "var str = ''; for ( p in Object ) { str += p; }; str" ) - ); - 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/ObjectObjects/15.2.3.1-2.js b/JavaScriptCore/tests/mozilla/ecma/ObjectObjects/15.2.3.1-2.js deleted file mode 100644 index fc2c735..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/ObjectObjects/15.2.3.1-2.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: 15.2.3.1-2.js - ECMA Section: 15.2.3.1 Object.prototype - - Description: The initial value of Object.prototype is the built-in - Object prototype object. - - This property shall have the attributes [ DontEnum, - DontDelete ReadOnly ] - - This tests the [DontDelete] property of Object.prototype - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ - - var SECTION = "15.2.3.1-2"; - var VERSION = "ECMA_1"; - startTest(); - var TITLE = "Object.prototype"; - - writeHeaderToLog( SECTION + " "+ TITLE); - - var testcases = getTestCases(); - test(); - -function getTestCases() { - var array = new Array(); - var item = 0; - array[item++] = new TestCase( SECTION, "delete( Object.prototype )", - false, - "delete( Object.prototype )" - ); - return ( array ); -} -function test( array ) { - for ( tc=0; tc < testcases.length; tc++ ) { - testcases[tc].actual = eval( testcases[tc].actual ); - 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/ObjectObjects/15.2.3.1-3.js b/JavaScriptCore/tests/mozilla/ecma/ObjectObjects/15.2.3.1-3.js deleted file mode 100644 index eb3a79d..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/ObjectObjects/15.2.3.1-3.js +++ /dev/null @@ -1,69 +0,0 @@ -/* The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is Mozilla Communicator client code, released March - * 31, 1998. - * - * The Initial Developer of the Original Code is Netscape Communications - * Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - */ -/** - File Name: 15.2.3.1-3.js - ECMA Section: 15.2.3.1 Object.prototype - - Description: The initial value of Object.prototype is the built-in - Object prototype object. - - This property shall have the attributes [ DontEnum, - DontDelete ReadOnly ] - - This tests the [ReadOnly] property of Object.prototype - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ - - var SECTION = "15.2.3.1-3"; - var VERSION = "ECMA_1"; - startTest(); - var TITLE = "Object.prototype"; - - writeHeaderToLog( SECTION + " "+ TITLE); - - var testcases = getTestCases(); - test(); - -function getTestCases() { - var array = new Array(); - var item = 0; - array[item++] = new TestCase( SECTION, "Object.prototype = null; Object.prototype", - Object.prototype, - "Object.prototype = null; Object.prototype" - ); - return ( array ); -} -function test( array ) { - for ( tc=0; tc < testcases.length; tc++ ) { - testcases[tc].actual = eval( testcases[tc].actual ); - 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/ObjectObjects/15.2.3.1-4.js b/JavaScriptCore/tests/mozilla/ecma/ObjectObjects/15.2.3.1-4.js deleted file mode 100644 index 8a39d7e..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/ObjectObjects/15.2.3.1-4.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: 15.2.3.1-4.js - ECMA Section: 15.2.3.1 Object.prototype - - Description: The initial value of Object.prototype is the built-in - Object prototype object. - - This property shall have the attributes [ DontEnum, - DontDelete ReadOnly ] - - This tests the [DontDelete] property of Object.prototype - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ - - var SECTION = "15.2.3.1-4"; - var VERSION = "ECMA_1"; - startTest(); - var TITLE = "Object.prototype"; - - writeHeaderToLog( SECTION + " "+ TITLE); - - var testcases = getTestCases(); - test(); - -function getTestCases() { - var array = new Array(); - var item = 0; - array[item++] = new TestCase( SECTION, "delete( Object.prototype ); Object.prototype", - Object.prototype, - "delete(Object.prototype); Object.prototype" - ); - return ( array ); -} -function test( array ) { - for ( tc=0; tc < testcases.length; tc++ ) { - testcases[tc].actual = eval(testcases[tc].actual); - 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/ObjectObjects/15.2.3.js b/JavaScriptCore/tests/mozilla/ecma/ObjectObjects/15.2.3.js deleted file mode 100644 index 152add9..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/ObjectObjects/15.2.3.js +++ /dev/null @@ -1,68 +0,0 @@ -/* The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is Mozilla Communicator client code, released March - * 31, 1998. - * - * The Initial Developer of the Original Code is Netscape Communications - * Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - */ -/** - File Name: 15.2.3.js - ECMA Section: 15.2.3 Properties of the Object Constructor - - Description: The value of the internal [[Prototype]] property of the - Object constructor is the Function prototype object. - - Besides the call and construct propreties and the length - property, the Object constructor has properties described - in 15.2.3.1. - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ - - var SECTION = "15.2.3"; - var VERSION = "ECMA_1"; - startTest(); - var TITLE = "Properties of the Object Constructor"; - - writeHeaderToLog( SECTION + " " + TITLE); - - var testcases = getTestCases(); - test(); - -function getTestCases() { - var array = new Array(); - var item = 0; - -// array[item++] = new TestCase( SECTION, "Object.__proto__", Function.prototype, Object.__proto__ ); - array[item++] = new TestCase( SECTION, "Object.length", 1, Object.length ); - - return ( array ); -} -function test( array ) { - for ( tc=0; tc < testcases.length; tc++ ) { - testcases[tc].actual = eval( testcases[tc].actual ); - 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/ObjectObjects/15.2.4.1.js b/JavaScriptCore/tests/mozilla/ecma/ObjectObjects/15.2.4.1.js deleted file mode 100644 index 61f2898..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/ObjectObjects/15.2.4.1.js +++ /dev/null @@ -1,63 +0,0 @@ -/* The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is Mozilla Communicator client code, released March - * 31, 1998. - * - * The Initial Developer of the Original Code is Netscape Communications - * Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - */ -/** - File Name: 15.2.4.1.js - ECMA Section: 15.2.4 Object.prototype.constructor - - Description: The initial value of the Object.prototype.constructor - is the built-in Object constructor. - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ - var SECTION = "15.2.4.1"; - var VERSION = "ECMA_1"; - startTest(); - var TITLE = "Object.prototype.constructor"; - - writeHeaderToLog( SECTION + " "+ TITLE); - - var testcases = getTestCases(); - test(); - -function getTestCases() { - var array = new Array(); - var item = 0; - array[item++] = new TestCase( SECTION, "Object.prototype.constructor", - Object, - Object.prototype.constructor - ); - return ( array ); -} -function test( array ) { - for ( tc=0; tc < testcases.length; tc++ ) { - testcases[tc].passed = writeTestCaseResult( - testcases[tc].expect, - testcases[tc].actual, - testcases[tc].description +" = "+ testcases[tc].actual ); - - testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; - } - stopTest(); - return ( testcases ); -} diff --git a/JavaScriptCore/tests/mozilla/ecma/ObjectObjects/15.2.4.2.js b/JavaScriptCore/tests/mozilla/ecma/ObjectObjects/15.2.4.2.js deleted file mode 100644 index 40eca1b..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/ObjectObjects/15.2.4.2.js +++ /dev/null @@ -1,128 +0,0 @@ -/* The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is Mozilla Communicator client code, released March - * 31, 1998. - * - * The Initial Developer of the Original Code is Netscape Communications - * Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - */ -/** - File Name: 15.2.4.2.js - ECMA Section: 15.2.4.2 Object.prototype.toString() - - Description: When the toString method is called, the following - steps are taken: - 1. Get the [[Class]] property of this object - 2. Call ToString( Result(1) ) - 3. Compute a string value by concatenating the three - strings "[object " + Result(2) + "]" - 4. Return Result(3). - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ - var SECTION = "15.2.4.2"; - var VERSION = "ECMA_1"; - startTest(); - var TITLE = "Object.prototype.toString()"; - - writeHeaderToLog( SECTION + " "+ TITLE); - - var testcases = getTestCases(); - test(); - -function getTestCases() { - var array = new Array(); - var item = 0; - - array[item++] = new TestCase( SECTION, "(new Object()).toString()", "[object Object]", (new Object()).toString() ); - - array[item++] = new TestCase( SECTION, "myvar = this; myvar.toString = Object.prototype.toString; myvar.toString()", - GLOBAL, - eval("myvar = this; myvar.toString = Object.prototype.toString; myvar.toString()") ); - - array[item++] = new TestCase( SECTION, "myvar = MyObject; myvar.toString = Object.prototype.toString; myvar.toString()", - "[object Function]", - eval("myvar = MyObject; myvar.toString = Object.prototype.toString; myvar.toString()") ); - - array[item++] = new TestCase( SECTION, "myvar = new MyObject( true ); myvar.toString = Object.prototype.toString; myvar.toString()", - '[object Object]', - eval("myvar = new MyObject( true ); myvar.toString = Object.prototype.toString; myvar.toString()") ); - - array[item++] = new TestCase( SECTION, "myvar = new Number(0); myvar.toString = Object.prototype.toString; myvar.toString()", - "[object Number]", - eval("myvar = new Number(0); myvar.toString = Object.prototype.toString; myvar.toString()") ); - - array[item++] = new TestCase( SECTION, "myvar = new String(''); myvar.toString = Object.prototype.toString; myvar.toString()", - "[object String]", - eval("myvar = new String(''); myvar.toString = Object.prototype.toString; myvar.toString()") ); - - array[item++] = new TestCase( SECTION, "myvar = Math; myvar.toString = Object.prototype.toString; myvar.toString()", - "[object Math]", - eval("myvar = Math; myvar.toString = Object.prototype.toString; myvar.toString()") ); - - array[item++] = new TestCase( SECTION, "myvar = new Function(); myvar.toString = Object.prototype.toString; myvar.toString()", - "[object Function]", - eval("myvar = new Function(); myvar.toString = Object.prototype.toString; myvar.toString()") ); - - array[item++] = new TestCase( SECTION, "myvar = new Array(); myvar.toString = Object.prototype.toString; myvar.toString()", - "[object Array]", - eval("myvar = new Array(); myvar.toString = Object.prototype.toString; myvar.toString()") ); - - array[item++] = new TestCase( SECTION, "myvar = new Boolean(); myvar.toString = Object.prototype.toString; myvar.toString()", - "[object Boolean]", - eval("myvar = new Boolean(); myvar.toString = Object.prototype.toString; myvar.toString()") ); - - array[item++] = new TestCase( SECTION, "myvar = new Date(); myvar.toString = Object.prototype.toString; myvar.toString()", - "[object Date]", - eval("myvar = new Date(); myvar.toString = Object.prototype.toString; myvar.toString()") ); - - array[item++] = new TestCase( SECTION, "var MYVAR = new Object( this ); MYVAR.toString()", - GLOBAL, - eval("var MYVAR = new Object( this ); MYVAR.toString()") ); - - array[item++] = new TestCase( SECTION, "var MYVAR = new Object(); MYVAR.toString()", - "[object Object]", - eval("var MYVAR = new Object(); MYVAR.toString()") ); - - array[item++] = new TestCase( SECTION, "var MYVAR = new Object(void 0); MYVAR.toString()", - "[object Object]", - eval("var MYVAR = new Object(void 0); MYVAR.toString()") ); - - array[item++] = new TestCase( SECTION, "var MYVAR = new Object(null); MYVAR.toString()", - "[object Object]", - eval("var MYVAR = new Object(null); MYVAR.toString()") ); - - return ( array ); -} -function test( array ) { - for ( tc=0 ; tc < testcases.length; tc++ ) { - testcases[tc].passed = writeTestCaseResult( - testcases[tc].expect, - testcases[tc].actual, - testcases[tc].description +" = "+ testcases[tc].actual ); - - testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; - } - stopTest(); - return ( testcases ); -} - -function MyObject( value ) { - this.value = new Function( "return this.value" ); - this.toString = new Function ( "return this.value+''"); -}
\ No newline at end of file diff --git a/JavaScriptCore/tests/mozilla/ecma/ObjectObjects/15.2.4.3.js b/JavaScriptCore/tests/mozilla/ecma/ObjectObjects/15.2.4.3.js deleted file mode 100644 index 1daf04a..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/ObjectObjects/15.2.4.3.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: 15.2.4.3.js - ECMA Section: 15.2.4.3 Object.prototype.valueOf() - - Description: As a rule, the valueOf method for an object simply - returns the object; but if the object is a "wrapper" - for a host object, as may perhaps be created by the - Object constructor, then the contained host object - should be returned. - - This only covers native objects. - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ - var SECTION = "15.2.4.3"; - var VERSION = "ECMA_1"; - startTest(); - var TITLE = "Object.prototype.valueOf()"; - - writeHeaderToLog( SECTION + " "+ TITLE); - - var testcases = getTestCases(); - test(); - -function getTestCases() { - var array = new Array(); - var item = 0; - - var myarray = new Array(); - myarray.valueOf = Object.prototype.valueOf; - var myboolean = new Boolean(); - myboolean.valueOf = Object.prototype.valueOf; - var myfunction = new Function(); - myfunction.valueOf = Object.prototype.valueOf; - var myobject = new Object(); - myobject.valueOf = Object.prototype.valueOf; - var mymath = Math; - mymath.valueOf = Object.prototype.valueOf; - var mydate = new Date(); - mydate.valueOf = Object.prototype.valueOf; - var mynumber = new Number(); - mynumber.valueOf = Object.prototype.valueOf; - var mystring = new String(); - mystring.valueOf = Object.prototype.valueOf; - - array[item++] = new TestCase( SECTION, "Object.prototype.valueOf.length", 0, Object.prototype.valueOf.length ); - - array[item++] = new TestCase( SECTION, - "myarray = new Array(); myarray.valueOf = Object.prototype.valueOf; myarray.valueOf()", - myarray, - myarray.valueOf() ); - array[item++] = new TestCase( SECTION, - "myboolean = new Boolean(); myboolean.valueOf = Object.prototype.valueOf; myboolean.valueOf()", - myboolean, - myboolean.valueOf() ); - array[item++] = new TestCase( SECTION, - "myfunction = new Function(); myfunction.valueOf = Object.prototype.valueOf; myfunction.valueOf()", - myfunction, - myfunction.valueOf() ); - array[item++] = new TestCase( SECTION, - "myobject = new Object(); myobject.valueOf = Object.prototype.valueOf; myobject.valueOf()", - myobject, - myobject.valueOf() ); - array[item++] = new TestCase( SECTION, - "mymath = Math; mymath.valueOf = Object.prototype.valueOf; mymath.valueOf()", - mymath, - mymath.valueOf() ); - array[item++] = new TestCase( SECTION, - "mynumber = new Number(); mynumber.valueOf = Object.prototype.valueOf; mynumber.valueOf()", - mynumber, - mynumber.valueOf() ); - array[item++] = new TestCase( SECTION, - "mystring = new String(); mystring.valueOf = Object.prototype.valueOf; mystring.valueOf()", - mystring, - mystring.valueOf() ); - array[item++] = new TestCase( SECTION, - "mydate = new Date(); mydate.valueOf = Object.prototype.valueOf; mydate.valueOf()", - mydate, - mydate.valueOf() ); - 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/ObjectObjects/15.2.4.js b/JavaScriptCore/tests/mozilla/ecma/ObjectObjects/15.2.4.js deleted file mode 100644 index 5a018c0..0000000 --- a/JavaScriptCore/tests/mozilla/ecma/ObjectObjects/15.2.4.js +++ /dev/null @@ -1,60 +0,0 @@ -/* The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is Mozilla Communicator client code, released March - * 31, 1998. - * - * The Initial Developer of the Original Code is Netscape Communications - * Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - */ -/** - File Name: 15.2.4.js - ECMA Section: 15.2.4 Properties of the Object prototype object - - Description: The value of the internal [[Prototype]] property of - the Object prototype object is null - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ - - var SECTION = "15.2.4"; - var VERSION = "ECMA_2"; - startTest(); - var TITLE = "Properties of the Object.prototype object"; - - writeHeaderToLog( SECTION + " "+ TITLE); - - var testcases = new Array(); - testcases[tc++] = new TestCase( SECTION, "Object.prototype.__proto__", - null, - Object.prototype.__proto__ - ); - - 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 ); -} |