зеркало из https://github.com/mozilla/gecko-dev.git
Updated test from Brendan, bug 290488
This commit is contained in:
Родитель
8700582fe8
Коммит
25c4b48342
|
@ -47,28 +47,23 @@ printStatus (summary);
|
|||
|
||||
printStatus(inSection(1));
|
||||
|
||||
function func()
|
||||
{
|
||||
return arguments.callee.__parent__ == GLOBAL;
|
||||
}
|
||||
function func() { return this; }
|
||||
|
||||
description = 'function with no closure arguments.callee.__parent__ == GLOBAL';
|
||||
expect = true;
|
||||
actual = func();
|
||||
description = 'top-level function: this == GLOBAL';
|
||||
expect = GLOBAL;
|
||||
actual = func.call();
|
||||
reportCompare(expect, actual, description);
|
||||
|
||||
printStatus(inSection(2));
|
||||
|
||||
function getclosure()
|
||||
function getBoundMethod()
|
||||
{
|
||||
return function () {
|
||||
return arguments.callee.__parent__ == GLOBAL;
|
||||
};
|
||||
return it.bindMethod("boundMethod", function () { return this; });
|
||||
}
|
||||
|
||||
description = 'function with closure arguments.callee.__parent__ == GLOBAL';
|
||||
var closure = getclosure();
|
||||
expect = true;
|
||||
actual = closure();
|
||||
description = 'bound method: this == GLOBAL';
|
||||
var func = getBoundMethod();
|
||||
expect = GLOBAL;
|
||||
actual = func.call();
|
||||
reportCompare(expect, actual, description);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче