From dd78c85d73d58514d4129b8c55ca0ad698e5b57f Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 25 Jun 2008 01:18:10 +0000 Subject: [PATCH] Reverting r2903, since it's not necessary, and, unless we decide to cast automatically in all the ZU functions, we should stay consistent --- chrome/content/zotero/xpcom/utilities.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/chrome/content/zotero/xpcom/utilities.js b/chrome/content/zotero/xpcom/utilities.js index 89c530702..e33f40626 100644 --- a/chrome/content/zotero/xpcom/utilities.js +++ b/chrome/content/zotero/xpcom/utilities.js @@ -156,16 +156,8 @@ Zotero.Utilities.prototype.cleanTags = function(x) { * => … */ Zotero.Utilities.prototype.htmlSpecialChars = function(str) { - switch (typeof str) { - case 'string': - break; - - case 'number': - str = str + ''; - break; - - default: - throw "Argument '" + str + "' must be a string in Zotero.Utilities.htmlSpecialChars()"; + if (typeof str != 'string') { + throw "Argument '" + str + "' must be a string in Zotero.Utilities.htmlSpecialChars()"; } if (!str) {