]>
git.saurik.com Git - apple/javascriptcore.git/blob - tests/mozilla/ecma/Number/15.7.4.js
1 /* The contents of this file are subject to the Netscape Public
2 * License Version 1.1 (the "License"); you may not use this file
3 * except in compliance with the License. You may obtain a copy of
4 * the License at http://www.mozilla.org/NPL/
6 * Software distributed under the License is distributed on an "AS
7 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
8 * implied. See the License for the specific language governing
9 * rights and limitations under the License.
11 * The Original Code is Mozilla Communicator client code, released March
14 * The Initial Developer of the Original Code is Netscape Communications
15 * Corporation. Portions created by Netscape are
16 * Copyright (C) 1998 Netscape Communications Corporation. All
28 The Number prototype object is itself a Number object (its [[Class]] is
29 "Number") whose value is +0.
31 The value of the internal [[Prototype]] property of the Number prototype
32 object is the Object prototype object (15.2.3.1).
34 In following descriptions of functions that are properties of the Number
35 prototype object, the phrase "this Number object" refers to the object
36 that is the this value for the invocation of the function; it is an error
37 if this does not refer to an object for which the value of the internal
38 [[Class]] property is "Number". Also, the phrase "this number value" refers
39 to the number value represented by this Number object, that is, the value
40 of the internal [[Value]] property of this Number object.
42 Author: christine@netscape.com
43 Date: 12 november 1997
45 var SECTION
= "15.7.4";
46 var VERSION
= "ECMA_1";
48 var TITLE
= "Properties of the Number Prototype Object";
50 writeHeaderToLog( SECTION
+ " "+TITLE
);
52 var testcases
= getTestCases();
55 function getTestCases() {
56 var array
= new Array();
58 array
[item
++] = new TestCase( SECTION
,
59 "Number.prototype.toString=Object.prototype.toString;Number.prototype.toString()",
61 eval("Number.prototype.toString=Object.prototype.toString;Number.prototype.toString()") );
62 array
[item
++] = new TestCase( SECTION
, "typeof Number.prototype", "object", typeof Number
.prototype );
63 array
[item
++] = new TestCase( SECTION
, "Number.prototype.valueOf()", 0, Number
.prototype.valueOf() );
66 // The __proto__ property cannot be used in ECMA_1 tests.
67 // array[item++] = new TestCase( SECTION, "Number.prototype.__proto__", Object.prototype, Number.prototype.__proto__ );
68 // array[item++] = new TestCase( SECTION, "Number.prototype.__proto__ == Object.prototype", true, Number.prototype.__proto__ == Object.prototype );
74 for ( tc
=0; tc
< testcases
.length
; tc
++ ) {
75 testcases
[tc
].passed
= writeTestCaseResult(
78 testcases
[tc
].description
+" = "+ testcases
[tc
].actual
);
80 testcases
[tc
].reason
+= ( testcases
[tc
].passed
) ? "" : "wrong value ";