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) {