| 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-018.js'; |
| 7 | |
| 8 | /** |
| 9 | File Name: lexical-018 |
| 10 | Corresponds To: 7.4.3-11-n.js |
| 11 | ECMA Section: 7.4.3 |
| 12 | |
| 13 | Description: |
| 14 | The following words are used as keywords in proposed extensions and are |
| 15 | therefore reserved to allow for the possibility of future adoption of |
| 16 | those extensions. |
| 17 | |
| 18 | FutureReservedWord :: one of |
| 19 | case debugger export super |
| 20 | catch default extends switch |
| 21 | class do finally throw |
| 22 | const enum import try |
| 23 | |
| 24 | Author: [email protected] |
| 25 | Date: 12 november 1997 |
| 26 | */ |
| 27 | var SECTION = "lexical-018"; |
| 28 | var VERSION = "JS1_4"; |
| 29 | var TITLE = "Future Reserved Words"; |
| 30 | |
| 31 | startTest(); |
| 32 | writeHeaderToLog( SECTION + " "+ TITLE); |
| 33 | |
| 34 | var result = "Failed"; |
| 35 | var exception = "No exception thrown"; |
| 36 | var expect = "Passed"; |
| 37 | |
| 38 | try { |
| 39 | eval("finally = true;"); |
| 40 | } catch ( e ) { |
| 41 | result = expect; |
| 42 | exception = e.toString(); |
| 43 | } |
| 44 | |
| 45 | new TestCase( |
| 46 | SECTION, |
| 47 | "finally = true" + |
| 48 | " (threw " + exception +")", |
| 49 | expect, |
| 50 | result ); |
| 51 | |
| 52 | test(); |
| 53 | |
| 54 |