1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/tests/js1_1/regress/function-001.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,45 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 + 1.10 +/** 1.11 + * File Name: boolean-001.js 1.12 + * Description: 1.13 + * 1.14 + * http://scopus.mcom.com/bugsplat/show_bug.cgi?id=99232 1.15 + * 1.16 + * eval("function f(){}function g(){}") at top level is an error for JS1.2 1.17 + and above (missing ; between named function expressions), but declares f 1.18 + and g as functions below 1.2. 1.19 + * 1.20 + * Fails to produce error regardless of version: 1.21 + * js> version(100) 1.22 + 120 1.23 + js> eval("function f(){}function g(){}") 1.24 + js> version(120); 1.25 + 100 1.26 + js> eval("function f(){}function g(){}") 1.27 + js> 1.28 + * Author: christine@netscape.com 1.29 + * Date: 11 August 1998 1.30 + */ 1.31 +var SECTION = "function-001.js"; 1.32 +var VERSION = "JS1_1"; 1.33 +var TITLE = "functions not separated by semicolons are not errors in version 110 "; 1.34 +var BUGNUMBER="99232"; 1.35 + 1.36 +startTest(); 1.37 +writeHeaderToLog( SECTION + " "+ TITLE); 1.38 + 1.39 +result = "passed"; 1.40 + 1.41 +new TestCase( 1.42 + SECTION, 1.43 + "eval(\"function f(){}function g(){}\")", 1.44 + void 0, 1.45 + eval("function f(){}function g(){}") ); 1.46 + 1.47 +test(); 1.48 +