js/src/tests/js1_2/function/Function_object.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 // |reftest| skip -- obsolete test
     2 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     3 /* This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     8 /**
     9    Filename:     Function_object.js
    10    Description:  'Testing Function objects'
    12    Author:       Nick Lerissa
    13    Date:         April 17, 1998
    14 */
    16 var SECTION = 'As described in Netscape doc "Whats new in JavaScript 1.2"';
    17 var VERSION = 'no version';
    18 startTest();
    19 var TITLE = 'functions: Function_object';
    21 writeHeaderToLog('Executing script: Function_object.js');
    22 writeHeaderToLog( SECTION + " "+ TITLE);
    25 function a_test_function(a,b,c)
    26 {
    27   return a + b + c;
    28 }
    30 f = a_test_function;
    33 new TestCase( SECTION, "f.name",
    34 	      'a_test_function',  f.name);
    36 new TestCase( SECTION, "f.length",
    37 	      3,  f.length);
    39 new TestCase( SECTION, "f.arity",
    40 	      3,  f.arity);
    42 new TestCase( SECTION, "f(2,3,4)",
    43 	      9,  f(2,3,4));
    45 var fnName = (version() == 120) ? '' : 'anonymous';
    47 new TestCase( SECTION, "(new Function()).name",
    48 	      fnName, (new Function()).name);
    50 new TestCase( SECTION, "(new Function()).toString()",
    51 	      'function ' + fnName + '() {\n}',  (new Function()).toString());
    53 test();

mercurial