avoid potentially bad JS for...in

svn: r10883

original commit: 55f2387f931a4d52e5e012a357c5e5282fd4e362
This commit is contained in:
Eli Barzilay 2008-07-23 19:05:15 +00:00
parent c6a534f0b4
commit e186bdee0f

View File

@ -2,8 +2,8 @@
function GetCookie(key, def) {
if (document.cookie.length <= 0) return def;
var cookiestrs = document.cookie.split(/; */);
for (var i in cookiestrs) {
var i, cookiestrs = document.cookie.split(/; */);
for (i = 0; i < cookiestrs.length; i++) {
var cur = cookiestrs[i];
var eql = cur.indexOf('=');
if (eql >= 0 && cur.substring(0,eql) == key)