Added two new sections to the test.
git-svn-id: svn://10.0.0.236/trunk@96397 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
6ce653cd9d
commit
fc17f35398
@ -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();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user