| 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
| 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
| 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 5 | |
| 6 | gTestfile = '15.7.4.js'; |
| 7 | |
| 8 | /** |
| 9 | File Name: 15.7.4.js |
| 10 | ECMA Section: 15.7.4 |
| 11 | |
| 12 | Description: |
| 13 | |
| 14 | The Number prototype object is itself a Number object (its [[Class]] is |
| 15 | "Number") whose value is +0. |
| 16 | |
| 17 | The value of the internal [[Prototype]] property of the Number prototype |
| 18 | object is the Object prototype object (15.2.3.1). |
| 19 | |
| 20 | In following descriptions of functions that are properties of the Number |
| 21 | prototype object, the phrase "this Number object" refers to the object |
| 22 | that is the this value for the invocation of the function; it is an error |
| 23 | if this does not refer to an object for which the value of the internal |
| 24 | [[Class]] property is "Number". Also, the phrase "this number value" refers |
| 25 | to the number value represented by this Number object, that is, the value |
| 26 | of the internal [[Value]] property of this Number object. |
| 27 | |
| 28 | Author: [email protected] |
| 29 | Date: 12 november 1997 |
| 30 | */ |
| 31 | var SECTION = "15.7.4"; |
| 32 | var VERSION = "ECMA_1"; |
| 33 | startTest(); |
| 34 | var TITLE = "Properties of the Number Prototype Object"; |
| 35 | |
| 36 | writeHeaderToLog( SECTION + " "+TITLE); |
| 37 | |
| 38 | new TestCase( SECTION, |
| 39 | "Number.prototype.toString=Object.prototype.toString;Number.prototype.toString()", |
| 40 | "[object Number]", |
| 41 | eval("Number.prototype.toString=Object.prototype.toString;Number.prototype.toString()") ); |
| 42 | |
| 43 | new TestCase( SECTION, |
| 44 | "typeof Number.prototype", |
| 45 | "object", |
| 46 | typeof Number.prototype ); |
| 47 | |
| 48 | new TestCase( SECTION, |
| 49 | "Number.prototype.valueOf()", |
| 50 | 0, |
| 51 | Number.prototype.valueOf() ); |
| 52 | |
| 53 | // The __proto__ property cannot be used in ECMA_1 tests. |
| 54 | // new TestCase( SECTION, "Number.prototype.__proto__", Object.prototype, Number.prototype.__proto__ ); |
| 55 | // new TestCase( SECTION, "Number.prototype.__proto__ == Object.prototype", true, Number.prototype.__proto__ == Object.prototype ); |
| 56 | |
| 57 | test(); |