| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
var gTestfile = '15.3.4.4.js'; |
| 7 |
|
| 8 |
var BUGNUMBER = 290488; |
| 9 |
var summary = '15.3.4.4 - Function.prototype.call() Scope'; |
| 10 |
var actual = ''; |
| 11 |
var expect = ''; |
| 12 |
var description = ''; |
| 13 |
var GLOBAL = this; |
| 14 |
|
| 15 |
printBugNumber(BUGNUMBER); |
| 16 |
printStatus (summary); |
| 17 |
|
| 18 |
printStatus(inSection(1)); |
| 19 |
|
| 20 |
function func() { return this; } |
| 21 |
|
| 22 |
description = 'top-level function: this == GLOBAL'; |
| 23 |
expect = GLOBAL; |
| 24 |
actual = func.call(); |
| 25 |
reportCompare(expect, actual, description); |
| 26 |
|
| 27 |
printStatus(inSection(2)); |
| 28 |
|
| 29 |
function getBoundMethod() |
| 30 |
{ |
| 31 |
return it.bindMethod("boundMethod", function () { return this; }); |
| 32 |
} |
| 33 |
|
| 34 |
|
| 35 |
if (typeof it != 'undefined') |
| 36 |
{ |
| 37 |
description = 'bound method: this == GLOBAL'; |
| 38 |
var func = getBoundMethod(); |
| 39 |
expect = GLOBAL; |
| 40 |
actual = func.call(); |
| 41 |
reportCompare(expect, actual, description); |
| 42 |
} |