From f289589830a0deaec0169672391b7b7ace6bc1cc Mon Sep 17 00:00:00 2001 From: Einar Egilsson Date: Sun, 18 Oct 2009 18:32:45 +0000 Subject: Issue with upgrading should be fixed git-svn-id: http://einaregilsson.googlecode.com/svn/mozilla/redirector/trunk@276 119bf307-c92d-0410-89bd-8f53e6181181 --- chrome/content/code/redirect.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'chrome/content/code/redirect.js') diff --git a/chrome/content/code/redirect.js b/chrome/content/code/redirect.js index dcd3596..439dd92 100644 --- a/chrome/content/code/redirect.js +++ b/chrome/content/code/redirect.js @@ -1,7 +1,9 @@ //// $Id$ -function Redirect(exampleUrl, includePattern, excludePattern, patternType, unescapeMatches, disabled) { - this._init(exampleUrl, includePattern, excludePattern, patternType, unescapeMatches, disabled); + exampleUrl,pattern,redirectUrl,patternType,excludePattern + +function Redirect(exampleUrl, includePattern, redirectUrl, patternType, excludePattern, unescapeMatches, disabled) { + this._init(exampleUrl, includePattern, redirectUrl, patternType, excludePattern, unescapeMatches, disabled); } //Static @@ -68,7 +70,7 @@ Redirect.prototype = { return new RegExp(this._preparePattern(pattern),"gi"); }, - _init : function(exampleUrl, includePattern, excludePattern, redirectUrl, patternType, unescapeMatches, disabled) { + _init : function(exampleUrl, includePattern, redirectUrl, patternType, excludePattern, unescapeMatches, disabled) { this.exampleUrl = exampleUrl || ''; this.includePattern = includePattern || ''; this.excludePattern = excludePattern || ''; @@ -101,24 +103,25 @@ Redirect.prototype = { test : function() { return this.getMatch(this.exampleUrl); }, + exampleUrl,pattern,redirectUrl,patternType,excludePattern serialize : function() { return [ this.exampleUrl , this.includePattern - , this.excludePattern , this.redirectUrl , this.patternType + , this.excludePattern , this.unescapeMatches , this.disabled ].join(',,,'); }, deserialize : function(str) { if (!str || !str.split) { - //TODO: THROW ERROR + throw Error("Invalid serialized redirect: " + str); } var parts = str.split(',,,'); if (parts.length < 5) { - ///TODO: throw + throw Error("Invalid serialized redirect, too few fields: " + str); } this._init.apply(this, parts); }, @@ -172,8 +175,8 @@ Redirect.prototype = { clone : function() { return new Redirect(this.exampleUrl, this.includePattern, - this.excludePattern, this.redirectUrl, - this.patternType, this.unescapeMatches, + this.redirectUrl, this.patternType, + this.excludePattern, this.unescapeMatches, this.disabled); }, -- cgit v1.2.3-70-g09d2