| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
gTestfile = 'lexical-021.js'; |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
var SECTION = "lexical-021.js"; |
| 28 |
var VERSION = "ECMA_1"; |
| 29 |
var TITLE = "Future Reserved Words"; |
| 30 |
|
| 31 |
startTest(); |
| 32 |
writeHeaderToLog( SECTION + " "+ TITLE); |
| 33 |
|
| 34 |
print("This test requires option javascript.options.strict enabled"); |
| 35 |
|
| 36 |
if (!options().match(/strict/)) |
| 37 |
{ |
| 38 |
options('strict'); |
| 39 |
} |
| 40 |
if (!options().match(/werror/)) |
| 41 |
{ |
| 42 |
options('werror'); |
| 43 |
} |
| 44 |
|
| 45 |
var result = "Failed"; |
| 46 |
var exception = "No exception thrown"; |
| 47 |
var expect = "Passed"; |
| 48 |
|
| 49 |
try { |
| 50 |
eval("enum = true;"); |
| 51 |
} catch ( e ) { |
| 52 |
result = expect; |
| 53 |
exception = e.toString(); |
| 54 |
} |
| 55 |
|
| 56 |
new TestCase( |
| 57 |
SECTION, |
| 58 |
"enum = true" + |
| 59 |
" (threw " + exception +")", |
| 60 |
expect, |
| 61 |
result ); |
| 62 |
|
| 63 |
test(); |