mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-05 00:02:37 +00:00
Added three more cases to the test.
This commit is contained in:
parent
28d425cd54
commit
e20c536dcb
@ -73,13 +73,45 @@ function f()
|
||||
|
||||
i=0;
|
||||
f();
|
||||
|
||||
status = inSection(1);
|
||||
actual = checkThis(i>0);
|
||||
expect = TEST_PASSED;
|
||||
expect = checkThis(true);
|
||||
addThis();
|
||||
|
||||
|
||||
// Now try in function scope -
|
||||
function g()
|
||||
{
|
||||
f();
|
||||
}
|
||||
|
||||
i=0;
|
||||
g();
|
||||
status = inSection(2);
|
||||
actual = checkThis(i>0);
|
||||
expect = checkThis(true);
|
||||
addThis();
|
||||
|
||||
|
||||
// Now try in eval scope -
|
||||
var sEval = 'function h(){++i; try{h();} catch(e){}}; i=0; h();';
|
||||
eval(sEval);
|
||||
status = inSection(3);
|
||||
actual = checkThis(i>0);
|
||||
expect = checkThis(true);
|
||||
addThis();
|
||||
|
||||
|
||||
// Try in eval scope and mix functions up -
|
||||
var sEval = 'function a(){++i; try{h();} catch(e){}}; i=0; a();';
|
||||
eval(sEval);
|
||||
status = inSection(4);
|
||||
actual = checkThis(i>0);
|
||||
expect = checkThis(true);
|
||||
addThis();
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
test();
|
||||
|
Loading…
x
Reference in New Issue
Block a user