| 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 = 'lexical-040.js'; |
| 7 | |
| 8 | /** |
| 9 | File Name: lexical-040.js |
| 10 | Corresponds To: 7.5-2.js |
| 11 | ECMA Section: 7.5 Identifiers |
| 12 | Description: Identifiers are of unlimited length |
| 13 | - can contain letters, a decimal digit, _, or $ |
| 14 | - the first character cannot be a decimal digit |
| 15 | - identifiers are case sensitive |
| 16 | |
| 17 | Author: [email protected] |
| 18 | Date: 11 september 1997 |
| 19 | */ |
| 20 | var SECTION = "lexical-040"; |
| 21 | var VERSION = "JS1_4"; |
| 22 | var TITLE = "Identifiers"; |
| 23 | |
| 24 | startTest(); |
| 25 | writeHeaderToLog( SECTION + " "+ TITLE); |
| 26 | |
| 27 | var result = "Failed"; |
| 28 | var exception = "No exception thrown"; |
| 29 | var expect = "Passed"; |
| 30 | |
| 31 | try { |
| 32 | eval("var 1abc;"); |
| 33 | } catch ( e ) { |
| 34 | result = expect; |
| 35 | exception = e.toString(); |
| 36 | } |
| 37 | |
| 38 | new TestCase( |
| 39 | SECTION, |
| 40 | "var 1abc" + |
| 41 | " (threw " + exception +")", |
| 42 | expect, |
| 43 | result ); |
| 44 | |
| 45 | test(); |
| 46 | |
| 47 |