From f9cd75c24e74e05c1da5dde446153ef56788aa4d Mon Sep 17 00:00:00 2001 From: Dhruva Ray Date: Fri, 29 Nov 2013 15:50:03 +0530 Subject: [PATCH] Use String.quote uniformly --- extension/chrome/content/spa_eye/hooks/bb/bbhook.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/extension/chrome/content/spa_eye/hooks/bb/bbhook.js b/extension/chrome/content/spa_eye/hooks/bb/bbhook.js index eb58a63..ef4ba84 100644 --- a/extension/chrome/content/spa_eye/hooks/bb/bbhook.js +++ b/extension/chrome/content/spa_eye/hooks/bb/bbhook.js @@ -178,10 +178,11 @@ define([ inferScriptForView:function (script_id) { var rendered = this._current.View; + var id = String.quote(script_id); if (rendered) {// Is this being rendered in context of a view? var templates = rendered.__templates__; - if (templates.indexOf(script_id) == -1) { - templates.push(script_id); + if (templates.indexOf(id) == -1) { + templates.push(id); } } }, @@ -193,7 +194,7 @@ define([ var f = encodeURIComponent("window[" + String.quote("_t"+ script_id) + "]=" + source); DOM.appendExternalScriptTagToHead(root.document, "data:text/javascript;fileName=" + String.quote(script_id) + ";," + f); - this._templates[script_id] = text; + this._templates[String.quote(script_id)] = text; } catch (e) { self.logError(e); }