Debian Codegraph @

rhino/testsrc/tests/js1_3/Script/function-002.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 = 'function-002.js';
7
8 /**
9 File Name: function-002.js
10 Section:
11 Description:
12
13 http://scopus.mcom.com/bugsplat/show_bug.cgi?id=249579
14
15 function definitions in conditional statements should be allowed.
16
17 Author: [email protected]
18 Date: 12 november 1997
19 */
20 var SECTION = "function-002";
21 var VERSION = "JS1_3";
22 var TITLE = "Regression test for 249579";
23 var BUGNUMBER="249579";
24
25 startTest();
26 writeHeaderToLog( SECTION + " "+ TITLE);
27
28 new TestCase(
29 SECTION,
30 "0?function(){}:0",
31 0,
32 0?function(){}:0 );
33
34
35 bar = true;
36 foo = bar ? function () { return true; } : function() { return false; };
37
38 new TestCase(
39 SECTION,
40 "bar = true; foo = bar ? function () { return true; } : function() { return false; }; foo()",
41 true,
42 foo() );
43
44
45 test();
46