| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
var gTestfile = 'regress-300079.js'; |
| 7 |
|
| 8 |
var BUGNUMBER = 300079; |
| 9 |
var summary = "precompiled functions should inherit from current window's Function.prototype"; |
| 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 |
if (typeof clone == 'undefined') { |
| 25 |
expect = 'SKIPPED'; |
| 26 |
actual = 'SKIPPED'; |
| 27 |
} |
| 28 |
else { |
| 29 |
expect = 'PASSED'; |
| 30 |
|
| 31 |
f = eval("(function (a) {return (function () { return a * a;}); })()"); |
| 32 |
g = clone(f, {a: 3}); |
| 33 |
f = null; |
| 34 |
gc(); |
| 35 |
try { |
| 36 |
a_squared = g(2); |
| 37 |
if (a_squared != 9) |
| 38 |
throw "Unexpected return from g: a_squared == " + a_squared; |
| 39 |
actual = "PASSED"; |
| 40 |
} catch (e) { |
| 41 |
actual = "FAILED: " + e; |
| 42 |
} |
| 43 |
} |
| 44 |
|
| 45 |
reportCompare(expect, actual, summary); |
| 46 |
|
| 47 |
exitFunc ('test'); |
| 48 |
} |