Debian Codegraph @

rhino/testsrc/tests/js1_4/Regress/function-001.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-001.js';
7
8 /**
9 * File Name: function-001.js
10 * Description:
11 *
12 * http://scopus.mcom.com/bugsplat/show_bug.cgi?id=325843
13 * js> function f(a){var a,b;}
14 *
15 * causes an an assert on a null 'sprop' in the 'Variables' function in
16 * jsparse.c This will crash non-debug build.
17 *
18 * Author: [email protected]
19 * Date: 11 August 1998
20 */
21 var SECTION = "function-001.js";
22 var VERSION = "JS1_4";
23 var TITLE = "Regression test case for 325843";
24 var BUGNUMBER="3258435";
25 startTest();
26
27 writeHeaderToLog( SECTION + " "+ TITLE);
28
29 eval("function f1 (a){ var a,b; }");
30
31 function f2( a ) { var a, b; };
32
33 new TestCase(
34 SECTION,
35 "eval(\"function f1 (a){ var a,b; }\"); "+
36 "function f2( a ) { var a, b; }; typeof f1",
37 "function",
38 typeof f1 );
39
40 // force a function decompilation
41
42 new TestCase(
43 SECTION,
44 "typeof f1.toString()",
45 "string",
46 typeof f1.toString() );
47
48 new TestCase(
49 SECTION,
50 "typeof f2",
51 "function",
52 typeof f2 );
53
54 // force a function decompilation
55
56 new TestCase(
57 SECTION,
58 "typeof f2.toString()",
59 "string",
60 typeof f2.toString() );
61
62 test();
63