Added two new sections to the test.

This commit is contained in:
pschwartau%netscape.com 2001-06-05 01:26:59 +00:00
Родитель 96c68a8c35
Коммит 4e4e073308
1 изменённых файлов: 39 добавлений и 0 удалений

Просмотреть файл

@ -34,6 +34,7 @@
var UBound = 0;
var bug = '(none)';
var summary = 'Testing that functions are scoped statically, not dynamically';
var self = this; // capture a reference to the global object
var status = '';
var statusitems = [ ];
var actual = '';
@ -166,6 +167,44 @@ expect = 2; // NOT 3 !!!
addThis();
/*
* Explicitly verify that f exists at global level, even though
* it was defined under the with(obj) block -
*/
status = 'Section G of test';
var a = 1;
var obj = {a:2};
with (obj)
{
function f()
{
return a;
}
}
actual = String([obj.hasOwnProperty('f'), self.hasOwnProperty('f')]);
expect = String([false, true]);
addThis();
/*
* Explicitly verify that f exists at global level, even though
* it was defined under the with(obj) block -
*/
status = 'Section H of test';
var a = 1;
var obj = {a:2};
with (obj)
{
function f()
{
return a;
}
}
actual = String(['f' in obj, 'f' in self]);
expect = String([false, true]);
addThis();
//-------------------------------------------------------------------------------------------------
test();