| 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 = 'regexparg-2-n.js'; |
| 7 | |
| 8 | /** |
| 9 | File Name: regexparg-1.js |
| 10 | Description: |
| 11 | |
| 12 | Regression test for |
| 13 | http://scopus/bugsplat/show_bug.cgi?id=122787 |
| 14 | Passing a regular expression as the first constructor argument fails |
| 15 | |
| 16 | Author: [email protected] |
| 17 | Date: 15 June 1998 |
| 18 | */ |
| 19 | |
| 20 | var SECTION = "JS_1.2"; |
| 21 | var VERSION = "JS_1.2"; |
| 22 | startTest(); |
| 23 | var TITLE = "The variable statement"; |
| 24 | |
| 25 | writeHeaderToLog( SECTION + " "+ TITLE); |
| 26 | |
| 27 | function f(x) {return x;} |
| 28 | |
| 29 | x = f(/abc/); |
| 30 | |
| 31 | DESCRIPTION = "function f(x) {return x;}; x = f(/abc/); x()"; |
| 32 | EXPECTED = "error"; |
| 33 | |
| 34 | new TestCase( SECTION, |
| 35 | "function f(x) {return x;}; x = f(/abc/); x()", |
| 36 | "error", |
| 37 | x() ); |
| 38 | |
| 39 | test(); |
| 40 |