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