js/src/tests/ecma/FunctionObjects/15.3.4.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/tests/ecma/FunctionObjects/15.3.4.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,47 @@
     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.3.4.js
    1.12 +   ECMA Section:       15.3.4  Properties of the Function Prototype Object
    1.13 +
    1.14 +   Description:        The Function prototype object is itself a Function
    1.15 +   object ( its [[Class]] is "Function") that, when
    1.16 +   invoked, accepts any arguments and returns undefined.
    1.17 +
    1.18 +   The value of the internal [[Prototype]] property
    1.19 +   object is the Object prototype object.
    1.20 +
    1.21 +   It is a function with an "empty body"; if it is
    1.22 +   invoked, it merely returns undefined.
    1.23 +
    1.24 +   The Function prototype object does not have a valueOf
    1.25 +   property of its own; however it inherits the valueOf
    1.26 +   property from the Object prototype Object.
    1.27 +
    1.28 +   Author:             christine@netscape.com
    1.29 +   Date:               28 october 1997
    1.30 +
    1.31 +*/
    1.32 +var SECTION = "15.3.4";
    1.33 +var VERSION = "ECMA_1";
    1.34 +startTest();
    1.35 +var TITLE   = "Properties of the Function Prototype Object";
    1.36 +
    1.37 +writeHeaderToLog( SECTION + " "+ TITLE);
    1.38 +
    1.39 +new TestCase(   SECTION,
    1.40 +		"var myfunc = Function.prototype; myfunc.toString = Object.prototype.toString; myfunc.toString()",
    1.41 +		"[object Function]",
    1.42 +		eval("var myfunc = Function.prototype; myfunc.toString = Object.prototype.toString; myfunc.toString()"));
    1.43 +
    1.44 +
    1.45 +//  new TestCase( SECTION,  "Function.prototype.__proto__",     Object.prototype,           Function.prototype.__proto__ );
    1.46 +new TestCase( SECTION,  "Function.prototype.valueOf",       Object.prototype.valueOf,   Function.prototype.valueOf );
    1.47 +new TestCase( SECTION,  "Function.prototype()",             (void 0),                   Function.prototype() );
    1.48 +new TestCase( SECTION,  "Function.prototype(1,true,false,'string', new Date(),null)",  (void 0), Function.prototype(1,true,false,'string', new Date(),null) );
    1.49 +
    1.50 +test();

mercurial