js/src/tests/ecma/extensions/15.7.4.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/tests/ecma/extensions/15.7.4.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,56 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +
    1.10 +/**
    1.11 +   File Name:          15.7.4.js
    1.12 +   ECMA Section:       15.7.4
    1.13 +
    1.14 +   Description:
    1.15 +
    1.16 +   The Number prototype object is itself a Number object (its [[Class]] is
    1.17 +   "Number") whose value is +0.
    1.18 +
    1.19 +   The value of the internal [[Prototype]] property of the Number prototype
    1.20 +   object is the Object prototype object (15.2.3.1).
    1.21 +
    1.22 +   In following descriptions of functions that are properties of the Number
    1.23 +   prototype object, the phrase "this Number object" refers to the object
    1.24 +   that is the this value for the invocation of the function; it is an error
    1.25 +   if this does not refer to an object for which the value of the internal
    1.26 +   [[Class]] property is "Number". Also, the phrase "this number value" refers
    1.27 +   to the number value represented by this Number object, that is, the value
    1.28 +   of the internal [[Value]] property of this Number object.
    1.29 +
    1.30 +   Author:             christine@netscape.com
    1.31 +   Date:               12 november 1997
    1.32 +*/
    1.33 +var SECTION = "15.7.4";
    1.34 +var VERSION = "ECMA_1";
    1.35 +startTest();
    1.36 +var TITLE   = "Properties of the Number Prototype Object";
    1.37 +
    1.38 +writeHeaderToLog( SECTION + " "+TITLE);
    1.39 +
    1.40 +new TestCase( SECTION,
    1.41 +	      "Number.prototype.toString=Object.prototype.toString;Number.prototype.toString()",
    1.42 +	      "[object Number]",
    1.43 +	      eval("Number.prototype.toString=Object.prototype.toString;Number.prototype.toString()") );
    1.44 +
    1.45 +new TestCase( SECTION,
    1.46 +	      "typeof Number.prototype",  
    1.47 +	      "object",
    1.48 +	      typeof Number.prototype );
    1.49 +
    1.50 +new TestCase( SECTION,
    1.51 +	      "Number.prototype.valueOf()", 
    1.52 +	      0,
    1.53 +	      Number.prototype.valueOf() );
    1.54 +
    1.55 +//    The __proto__ property cannot be used in ECMA_1 tests.
    1.56 +//    new TestCase( SECTION, "Number.prototype.__proto__",                        Object.prototype,   Number.prototype.__proto__ );
    1.57 +//    new TestCase( SECTION, "Number.prototype.__proto__ == Object.prototype",    true,       Number.prototype.__proto__ == Object.prototype );
    1.58 +
    1.59 +test();

mercurial