Imported tests
[mono.git] / mcs / class / Microsoft.JScript / Test / Mozilla / js1_5 / Regress / regress-10278.js
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\r
2 /* ***** BEGIN LICENSE BLOCK *****\r
3  * Version: MPL 1.1/GPL 2.0/LGPL 2.1\r
4  *\r
5  * The contents of this file are subject to the Mozilla Public License Version\r
6  * 1.1 (the "License"); you may not use this file except in compliance with\r
7  * the License. You may obtain a copy of the License at\r
8  * http://www.mozilla.org/MPL/\r
9  *\r
10  * Software distributed under the License is distributed on an "AS IS" basis,\r
11  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\r
12  * for the specific language governing rights and limitations under the\r
13  * License.\r
14  *\r
15  * The Original Code is JavaScript Engine testing utilities.\r
16  *\r
17  * The Initial Developer of the Original Code is\r
18  * Mozilla Foundation.\r
19  * Portions created by the Initial Developer are Copyright (C) 2005\r
20  * the Initial Developer. All Rights Reserved.\r
21  *\r
22  * Contributor(s): Bob Clary <bob@bclary.com>\r
23  *\r
24  * Alternatively, the contents of this file may be used under the terms of\r
25  * either the GNU General Public License Version 2 or later (the "GPL"), or\r
26  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),\r
27  * in which case the provisions of the GPL or the LGPL are applicable instead\r
28  * of those above. If you wish to allow use of your version of this file only\r
29  * under the terms of either the GPL or the LGPL, and not to allow others to\r
30  * use your version of this file under the terms of the MPL, indicate your\r
31  * decision by deleting the provisions above and replace them with the notice\r
32  * and other provisions required by the GPL or the LGPL. If you do not delete\r
33  * the provisions above, a recipient may use your version of this file under\r
34  * the terms of any one of the MPL, the GPL or the LGPL.\r
35  *\r
36  * ***** END LICENSE BLOCK ***** */\r
37 /**\r
38  *  File Name:          regress-10278.js\r
39  *  Reference:          https://bugzilla.mozilla.org/show_bug.cgi?id=10278\r
40  *  Description:        Function declarations do not need to be separated\r
41  *                      by semi-colon if they occur on the same line.\r
42  *  Author:             bob@bclary.com\r
43  */\r
44 //-----------------------------------------------------------------------------\r
45 var bug = 10278;\r
46 var summary = 'Function declarations do not need to be separated by semi-colon';\r
47 var actual;\r
48 var expect;\r
49 \r
50 \r
51 //-----------------------------------------------------------------------------\r
52 test();\r
53 //-----------------------------------------------------------------------------\r
54 \r
55 function test()\r
56 {\r
57   enterFunc ('test');\r
58   printBugNumber (bug);\r
59   printStatus (summary);\r
60 \r
61   expect = 'pass';\r
62   try \r
63   {\r
64     eval("function f(){}function g(){}");\r
65     actual = "pass";\r
66     printStatus('no exception thrown');\r
67   } \r
68   catch ( e ) \r
69   {\r
70     actual = "fail";\r
71     printStatus('exception ' + e.toString() + ' thrown');\r
72   }\r
73 \r
74   reportCompare(expect, actual, summary);\r
75 \r
76   exitFunc ('test');\r
77 }\r