1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/tests/js1_2/function/Function_object.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,54 @@ 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 + Filename: Function_object.js 1.13 + Description: 'Testing Function objects' 1.14 + 1.15 + Author: Nick Lerissa 1.16 + Date: April 17, 1998 1.17 +*/ 1.18 + 1.19 +var SECTION = 'As described in Netscape doc "Whats new in JavaScript 1.2"'; 1.20 +var VERSION = 'no version'; 1.21 +startTest(); 1.22 +var TITLE = 'functions: Function_object'; 1.23 + 1.24 +writeHeaderToLog('Executing script: Function_object.js'); 1.25 +writeHeaderToLog( SECTION + " "+ TITLE); 1.26 + 1.27 + 1.28 +function a_test_function(a,b,c) 1.29 +{ 1.30 + return a + b + c; 1.31 +} 1.32 + 1.33 +f = a_test_function; 1.34 + 1.35 + 1.36 +new TestCase( SECTION, "f.name", 1.37 + 'a_test_function', f.name); 1.38 + 1.39 +new TestCase( SECTION, "f.length", 1.40 + 3, f.length); 1.41 + 1.42 +new TestCase( SECTION, "f.arity", 1.43 + 3, f.arity); 1.44 + 1.45 +new TestCase( SECTION, "f(2,3,4)", 1.46 + 9, f(2,3,4)); 1.47 + 1.48 +var fnName = (version() == 120) ? '' : 'anonymous'; 1.49 + 1.50 +new TestCase( SECTION, "(new Function()).name", 1.51 + fnName, (new Function()).name); 1.52 + 1.53 +new TestCase( SECTION, "(new Function()).toString()", 1.54 + 'function ' + fnName + '() {\n}', (new Function()).toString()); 1.55 + 1.56 +test(); 1.57 +