From 54b385f8fa807d01131cd2cc705ba2fa3e82ea35 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 29 Jul 2008 17:55:44 +0000 Subject: [PATCH] Fix a few JS strict warnings --- chrome/content/zotero/preferences/proxyEditor.js | 2 +- chrome/content/zotero/xpcom/proxy.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/chrome/content/zotero/preferences/proxyEditor.js b/chrome/content/zotero/preferences/proxyEditor.js index 9bed4fae0..524bb87b1 100644 --- a/chrome/content/zotero/preferences/proxyEditor.js +++ b/chrome/content/zotero/preferences/proxyEditor.js @@ -20,7 +20,7 @@ ***** END LICENSE BLOCK ***** */ -Zotero_ProxyEditor = new function() { +var Zotero_ProxyEditor = new function() { var treechildren; var tree; var treecol; diff --git a/chrome/content/zotero/xpcom/proxy.js b/chrome/content/zotero/xpcom/proxy.js index c0d6428a8..a7ba4c115 100644 --- a/chrome/content/zotero/xpcom/proxy.js +++ b/chrome/content/zotero/xpcom/proxy.js @@ -270,13 +270,13 @@ Zotero.Proxy.prototype.compileRegexp = function() { var parametersToCheck = Zotero_Proxy_schemeParameters; if(this.multiHost) parametersToCheck["%h"] = "([a-zA-Z0-9]+\\.[a-zA-Z0-9\.]+)"; - indices = this.indices = {}; + var indices = this.indices = {}; this.parameters = []; for(var param in parametersToCheck) { var index = this.scheme.indexOf(param); // avoid escaped matches - while(this.scheme[index-1] == "%") { + while(this.scheme[index-1] && (this.scheme[index-1] == "%")) { this.scheme = this.scheme.substr(0, index-1)+this.scheme.substr(index); index = this.scheme.indexOf(param, index+1); } @@ -402,9 +402,9 @@ Zotero.Proxy.prototype.erase = function() { */ Zotero.Proxy.prototype.toProper = function(m) { if(this.multiHost) { - properURL = "http://"+m[this.parameters.indexOf("%h")+1]+"/"; + var properURL = "http://"+m[this.parameters.indexOf("%h")+1]+"/"; } else { - properURL = "http://"+this.hosts[0]+"/"; + var properURL = "http://"+this.hosts[0]+"/"; } if(this.indices["%p"]) {