js/src/tests/js1_2/function/length.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/tests/js1_2/function/length.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,63 @@
     1.4 +// |reftest| skip -- obsolete test
     1.5 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +
    1.11 +/**
    1.12 +   File Name:          15.3.5.1.js
    1.13 +   ECMA Section:       Function.length
    1.14 +   Description:
    1.15 +
    1.16 +   The value of the length property is usually an integer that indicates the
    1.17 +   "typical" number of arguments expected by the function.  However, the
    1.18 +   language permits the function to be invoked with some other number of
    1.19 +   arguments. The behavior of a function when invoked on a number of arguments
    1.20 +   other than the number specified by its length property depends on the function.
    1.21 +
    1.22 +   This checks the pre-ecma behavior Function.length.
    1.23 +
    1.24 +   http://scopus.mcom.com/bugsplat/show_bug.cgi?id=104204
    1.25 +
    1.26 +
    1.27 +   Author:             christine@netscape.com
    1.28 +   Date:               12 november 1997
    1.29 +*/
    1.30 +
    1.31 +var SECTION = "function/length.js";
    1.32 +var VERSION = "ECMA_1";
    1.33 +var TITLE   = "Function.length";
    1.34 +var BUGNUMBER="104204";
    1.35 +
    1.36 +startTest();
    1.37 +writeHeaderToLog( SECTION + " "+ TITLE);
    1.38 +
    1.39 +var f = new Function( "a","b", "c", "return f.length");
    1.40 +
    1.41 +if ( version() <= 120 ) {
    1.42 +
    1.43 +  new TestCase( SECTION,
    1.44 +		'var f = new Function( "a","b", "c", "return f.length"); f()',
    1.45 +		0,
    1.46 +		f() );
    1.47 +
    1.48 +  new TestCase( SECTION,
    1.49 +		'var f = new Function( "a","b", "c", "return f.length"); f(1,2,3,4,5)',
    1.50 +		5,
    1.51 +		f(1,2,3,4,5) );
    1.52 +} else {
    1.53 +
    1.54 +  new TestCase( SECTION,
    1.55 +		'var f = new Function( "a","b", "c", "return f.length"); f()',
    1.56 +		3,
    1.57 +		f() );
    1.58 +
    1.59 +  new TestCase( SECTION,
    1.60 +		'var f = new Function( "a","b", "c", "return f.length"); f(1,2,3,4,5)',
    1.61 +		3,
    1.62 +		f(1,2,3,4,5) );
    1.63 +
    1.64 +
    1.65 +}
    1.66 +test();

mercurial