| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
var gTestfile = 'regress-427798.js'; |
| 7 |
|
| 8 |
var BUGNUMBER = 427798; |
| 9 |
var summary = 'js_PutBlockObject is slow'; |
| 10 |
var actual = 'Good result'; |
| 11 |
var expect = 'Good result'; |
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
test(); |
| 16 |
|
| 17 |
|
| 18 |
function test() |
| 19 |
{ |
| 20 |
enterFunc ('test'); |
| 21 |
printBugNumber(BUGNUMBER); |
| 22 |
printStatus (summary); |
| 23 |
|
| 24 |
function f(N) |
| 25 |
{ |
| 26 |
for (var i = 0; i != N; ++i) { |
| 27 |
var f, g; |
| 28 |
{ |
| 29 |
let j = i + 1; |
| 30 |
f = function() { j += 2; return j; } |
| 31 |
if (f() != i + 3) |
| 32 |
throw "Bad result"; |
| 33 |
} |
| 34 |
if (f() != i + 5) |
| 35 |
throw "Bad result"; |
| 36 |
{ |
| 37 |
let j = i + 1, k = i + 2; |
| 38 |
f = function() { j += 2; k++; return j + k; } |
| 39 |
if (f() != i + i + 6) |
| 40 |
throw "Bad result"; |
| 41 |
} |
| 42 |
if (f() != i + i + 9) |
| 43 |
throw "Bad result"; |
| 44 |
} |
| 45 |
} |
| 46 |
|
| 47 |
try |
| 48 |
{ |
| 49 |
f(20*1000); |
| 50 |
} |
| 51 |
catch(ex) |
| 52 |
{ |
| 53 |
actual = ex + ''; |
| 54 |
} |
| 55 |
|
| 56 |
reportCompare(expect, actual, summary); |
| 57 |
|
| 58 |
exitFunc ('test'); |
| 59 |
} |