Another JScript eval bug

B

Bryan Mills

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;
however, it prints "12".
 
E

Evertjan.

Bryan Mills wrote on 31 mei 2004 in
microsoft.public.inetserver.asp.general:
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;
however, it prints "12".

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top