| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
var gTestfile = 'regress-352268.js'; |
| 7 |
|
| 8 |
var BUGNUMBER = 352268; |
| 9 |
var summary = 'decompilation should not change scope of |let| in |else|...|if|'; |
| 10 |
var actual = ''; |
| 11 |
var expect = ''; |
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
test(); |
| 16 |
|
| 17 |
|
| 18 |
function test() |
| 19 |
{ |
| 20 |
enterFunc ('test'); |
| 21 |
printBugNumber(BUGNUMBER); |
| 22 |
printStatus (summary); |
| 23 |
|
| 24 |
var c; |
| 25 |
var f; |
| 26 |
|
| 27 |
try |
| 28 |
{ |
| 29 |
c = '(function() { if(x) { } else if (y) let b=2; })'; |
| 30 |
f = eval(c); |
| 31 |
expect = 'function() { if(x) { } else if (y) let b=2; }'; |
| 32 |
actual = f + ''; |
| 33 |
compareSource(expect, actual, summary); |
| 34 |
} |
| 35 |
catch(ex) |
| 36 |
{ |
| 37 |
|
| 38 |
summary = 'let declaration must be direct child of block or top-level implicit block'; |
| 39 |
expect = 'SyntaxError'; |
| 40 |
actual = ex.name; |
| 41 |
reportCompare(expect, actual, summary); |
| 42 |
} |
| 43 |
|
| 44 |
exitFunc ('test'); |
| 45 |
} |