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