| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
var gTestfile = 'regress-422269.js'; |
| 7 |
|
| 8 |
var BUGNUMBER = 422269; |
| 9 |
var summary = 'Compile-time let block should not capture runtime references'; |
| 10 |
var actual = 'No leak'; |
| 11 |
var expect = 'No leak'; |
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
test(); |
| 16 |
|
| 17 |
|
| 18 |
function test() |
| 19 |
{ |
| 20 |
enterFunc ('test'); |
| 21 |
printBugNumber(BUGNUMBER); |
| 22 |
printStatus (summary); |
| 23 |
|
| 24 |
function f() |
| 25 |
{ |
| 26 |
let m = {sin: Math.sin}; |
| 27 |
(function() { m.sin(1); })(); |
| 28 |
return m; |
| 29 |
} |
| 30 |
|
| 31 |
if (typeof countHeap == 'undefined') |
| 32 |
{ |
| 33 |
expect = actual = 'Test skipped'; |
| 34 |
print('Test skipped. Requires countHeap function.'); |
| 35 |
} |
| 36 |
else |
| 37 |
{ |
| 38 |
var x = f(); |
| 39 |
gc(); |
| 40 |
var n = countHeap(); |
| 41 |
x = null; |
| 42 |
gc(); |
| 43 |
|
| 44 |
var n2 = countHeap(); |
| 45 |
if (n2 >= n) |
| 46 |
actual = "leak is detected, something roots the result of f"; |
| 47 |
} |
| 48 |
reportCompare(expect, actual, summary); |
| 49 |
|
| 50 |
exitFunc ('test'); |
| 51 |
} |