Bug 601307 - Add a test for directness of the eval in |with (...) eval(...)| (assuming eval is the global eval function). r=jimb

--HG--
extra : rebase_source : 9a6b233cd99a3f9016c760f1249497d5a39d0c55
This commit is contained in:
Jeff Walden 2010-10-01 18:40:11 -07:00
parent 44405a40a0
commit 9361db8ece
2 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,28 @@
// Any copyright is dedicated to the Public Domain.
// http://creativecommons.org/licenses/publicdomain/
//-----------------------------------------------------------------------------
var BUGNUMBER = 601307;
var summary = "with (...) eval(...) is a direct eval";
print(BUGNUMBER + ": " + summary);
/**************
* BEGIN TEST *
**************/
var t = "global";
function test()
{
var t = "local";
with ({})
return eval("t");
}
assertEq(test(), "local");
/******************************************************************************/
if (typeof reportCompare === "function")
reportCompare(true, true);
print("All tests passed!");

View File

@ -2,3 +2,4 @@ url-prefix ../../jsreftest.html?test=ecma_5/Global/
script parseInt-01.js
script eval-01.js
script eval-02.js
script eval-inside-with-is-direct.js