Groups | Blog | Home
all groups > inetserver asp general > may 2004 >

inetserver asp general : Another JScript eval bug



Bryan Mills
5/31/2004 9:52:02 AM
According to MSDN: "new variables or types defined in the
eval statement are not visible to the enclosing program."

However, in some cases under IIS 5, this is not the case.
Try the following program:
eval("var z = 12; 5;");
Response.Write(z);

According to the documentation this should be an error;
Evertjan.
5/31/2004 5:25:56 PM
Bryan Mills wrote on 31 mei 2004 in
microsoft.public.inetserver.asp.general:

[quoted text, click to view]

eval is the root of all evil, take it away....


[IE clientside tested:]

a=eval("z = 12");
document.write(a); // 12


a=eval("var z = 12");
document.write(a); // undefined




--
Evertjan.
The Netherlands.
AddThis Social Bookmark Button