Debian Codegraph @

rhino/testsrc/tests/js1_2/function/definition-1.js

raw symbols SCIP
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 gTestfile = 'definition-1.js';
7
8 /**
9 File Name: definition-1.js
10 Reference: http://scopus.mcom.com/bugsplat/show_bug.cgi?id=111284
11 Description: Regression test for declaring functions.
12
13 Author: [email protected]
14 Date: 15 June 1998
15 */
16
17 var SECTION = "function/definition-1.js";
18 var VERSION = "JS_12";
19 startTest();
20 var TITLE = "Regression test for 111284";
21
22 writeHeaderToLog( SECTION + " "+ TITLE);
23
24 f1 = function() { return "passed!" }
25
26 function f2() { f3 = function() { return "passed!" }; return f3(); }
27
28 new TestCase( SECTION,
29 'f1 = function() { return "passed!" }; f1()',
30 "passed!",
31 f1() );
32
33 new TestCase( SECTION,
34 'function f2() { f3 = function { return "passed!" }; return f3() }; f2()',
35 "passed!",
36 f2() );
37
38 new TestCase( SECTION,
39 'f3()',
40 "passed!",
41 f3() );
42
43 test();
44