| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
var gTestfile = 'regress-193555.js'; |
| 16 |
var UBound = 0; |
| 17 |
var BUGNUMBER = 193555; |
| 18 |
var summary = 'Testing access to function name from inside function'; |
| 19 |
var status = ''; |
| 20 |
var statusitems = []; |
| 21 |
var actual = ''; |
| 22 |
var actualvalues = []; |
| 23 |
var expect= ''; |
| 24 |
var expectedvalues = []; |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
status = inSection(1); |
| 29 |
function f() {return f.toString();}; |
| 30 |
actual = f(); |
| 31 |
expect = f.toString(); |
| 32 |
addThis(); |
| 33 |
|
| 34 |
|
| 35 |
status = inSection(2); |
| 36 |
var x = function g() {return g.toString();}; |
| 37 |
actual = x(); |
| 38 |
expect = x.toString(); |
| 39 |
addThis(); |
| 40 |
|
| 41 |
|
| 42 |
status = inSection(3); |
| 43 |
eval ('function a() {return a.toString();}'); |
| 44 |
actual = a(); |
| 45 |
expect = a.toString(); |
| 46 |
addThis(); |
| 47 |
|
| 48 |
status = inSection(4); |
| 49 |
eval ('var y = function b() {return b.toString();}'); |
| 50 |
actual = y(); |
| 51 |
expect = y.toString(); |
| 52 |
addThis(); |
| 53 |
|
| 54 |
|
| 55 |
status = inSection(5); |
| 56 |
function c() {return eval('c').toString();}; |
| 57 |
actual = c(); |
| 58 |
expect = c.toString(); |
| 59 |
addThis(); |
| 60 |
|
| 61 |
status = inSection(6); |
| 62 |
var z = function d() {return eval('d').toString();}; |
| 63 |
actual = z(); |
| 64 |
expect = z.toString(); |
| 65 |
addThis(); |
| 66 |
|
| 67 |
|
| 68 |
status = inSection(7); |
| 69 |
eval('var w = function e() {return eval("e").toString();}'); |
| 70 |
actual = w(); |
| 71 |
expect = w.toString(); |
| 72 |
addThis(); |
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
test(); |
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
function addThis() |
| 83 |
{ |
| 84 |
statusitems[UBound] = status; |
| 85 |
actualvalues[UBound] = actual; |
| 86 |
expectedvalues[UBound] = expect; |
| 87 |
UBound++; |
| 88 |
} |
| 89 |
|
| 90 |
|
| 91 |
function test() |
| 92 |
{ |
| 93 |
enterFunc('test'); |
| 94 |
printBugNumber(BUGNUMBER); |
| 95 |
printStatus(summary); |
| 96 |
|
| 97 |
for (var i=0; i<UBound; i++) |
| 98 |
{ |
| 99 |
reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]); |
| 100 |
} |
| 101 |
|
| 102 |
exitFunc ('test'); |
| 103 |
} |