js/src/tests/ecma/FunctionObjects/15.3.4-1.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-1.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,60 @@
     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-1.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 +
    1.33 +var SECTION = "15.3.4-1";
    1.34 +var VERSION = "ECMA_1";
    1.35 +startTest();
    1.36 +var TITLE   = "Properties of the Function Prototype Object";
    1.37 +
    1.38 +writeHeaderToLog( SECTION + " "+ TITLE);
    1.39 +
    1.40 +new TestCase( SECTION,
    1.41 +	      "var myfunc = Function.prototype; myfunc.toString = Object.prototype.toString; myfunc.toString()",
    1.42 +	      "[object Function]",
    1.43 +	      eval("var myfunc = Function.prototype; myfunc.toString = Object.prototype.toString; myfunc.toString()"));
    1.44 +
    1.45 +
    1.46 +//  new TestCase( SECTION,  "Function.prototype.__proto__",     Object.prototype,           Function.prototype.__proto__ );
    1.47 +
    1.48 +new TestCase( SECTION, 
    1.49 +	      "Function.prototype.valueOf",      
    1.50 +	      Object.prototype.valueOf,  
    1.51 +	      Function.prototype.valueOf );
    1.52 +
    1.53 +new TestCase( SECTION, 
    1.54 +	      "Function.prototype()",            
    1.55 +	      (void 0),                  
    1.56 +	      Function.prototype() );
    1.57 +
    1.58 +new TestCase( SECTION, 
    1.59 +	      "Function.prototype(1,true,false,'string', new Date(),null)", 
    1.60 +	      (void 0),
    1.61 +	      Function.prototype(1,true,false,'string', new Date(),null) );
    1.62 +
    1.63 +test();

mercurial