| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
var gTestfile = 'regress-352732.js'; |
| 7 |
|
| 8 |
var BUGNUMBER = 352732; |
| 9 |
var summary = 'Decompiling "if (x) L: let x;"'; |
| 10 |
var summarytrunk = 'let declaration must be direct child of block or top-level implicit block'; |
| 11 |
var actual = ''; |
| 12 |
var expect = ''; |
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
test(); |
| 17 |
|
| 18 |
|
| 19 |
function test() |
| 20 |
{ |
| 21 |
enterFunc ('test'); |
| 22 |
printBugNumber(BUGNUMBER); |
| 23 |
printStatus (summary); |
| 24 |
|
| 25 |
var c; |
| 26 |
var f; |
| 27 |
|
| 28 |
try |
| 29 |
{ |
| 30 |
c = '(function() { if (x) L: let x; })'; |
| 31 |
f = eval(c); |
| 32 |
expect = 'function() { if (x) { L: let x; } }'; |
| 33 |
actual = f + ''; |
| 34 |
compareSource(expect, actual, summary); |
| 35 |
} |
| 36 |
catch(ex) |
| 37 |
{ |
| 38 |
|
| 39 |
expect = 'SyntaxError'; |
| 40 |
actual = ex.name; |
| 41 |
reportCompare(expect, actual, summarytrunk + ': ' + c); |
| 42 |
} |
| 43 |
|
| 44 |
try |
| 45 |
{ |
| 46 |
c = '(function() { if (x) L: let x; else y; })'; |
| 47 |
f = eval(c); |
| 48 |
expect = 'function() { if (x) { L: let x; } else { y;} }'; |
| 49 |
actual = f + ''; |
| 50 |
compareSource(expect, actual, summary); |
| 51 |
} |
| 52 |
catch(ex) |
| 53 |
{ |
| 54 |
|
| 55 |
expect = 'SyntaxError'; |
| 56 |
actual = ex.name; |
| 57 |
reportCompare(expect, actual, summarytrunk + ': ' + c); |
| 58 |
} |
| 59 |
|
| 60 |
exitFunc ('test'); |
| 61 |
} |