From 6bae548e0a408a21c76ac6039f83df086a91767a Mon Sep 17 00:00:00 2001 From: Tobie Langel Date: Sun, 16 Mar 2008 19:08:34 +0000 Subject: [PATCH] prototype: Refactor String#escapeHTML to avoid using the with statement. --- CHANGELOG | 2 ++ src/string.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index f3fe5a3..64cc945 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +* Refactor String#escapeHTML to avoid using the `with` statement. [Tobie Langel] + * Remove usage of the `with` statement from unit tests. [Tobie Langel] * Complete rewrite of the deprecation helper, now renamed UpdateHelper and useable by third-party libs. [Tobie Langel] diff --git a/src/string.js b/src/string.js index 15791b7..58f79c2 100644 --- a/src/string.js +++ b/src/string.js @@ -228,7 +228,7 @@ Object.extend(String.prototype.escapeHTML, { text: document.createTextNode('') }); -with (String.prototype.escapeHTML) div.appendChild(text); +String.prototype.escapeHTML.div.appendChild(String.prototype.escapeHTML.text); var Template = Class.create({ initialize: function(template, pattern) {