From 1061c6fd4654690ffce9c4f4daee1de504a79584 Mon Sep 17 00:00:00 2001 From: jdalton Date: Tue, 24 Jun 2008 12:49:16 -0500 Subject: [PATCH] Fix Element._attributeTranslations.read.values._getEv to use Function.prototype.toString and only return if value is wrapped in an anonymous function --- CHANGELOG | 2 ++ src/dom.js | 4 +++- 2 files changed, 5 insertions(+), 1 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index a2ae5bc..038a7d5 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +* Make Element._attributeTranslations.read.values._getEv use Function.prototype.toString and return value only if wrapped in an anonymous function. [#184 state:resolved] [Garrett Smith, jddalton] + * Remove the use of indexOf in Emumerable#include because Array#indexOf uses strict strict equality. [#183 state:resolved] [Garrett Smith, jjdalton] * Make Prototype.BrowserFeatures.SpecificElementExtensions more accurate by checking typeof for div and form elements. [#182 state:resolved] [Garrett Smith, jjdalton] diff --git a/src/dom.js b/src/dom.js index 0bc9f76..4fd197f 100644 --- a/src/dom.js +++ b/src/dom.js @@ -926,7 +926,9 @@ else if (Prototype.Browser.IE) { _getEv: function(element, attribute) { attribute = element.getAttribute(attribute); - return attribute ? attribute.toString().slice(23, -2) : null; + if (!Object.isFunction(attribute)) return null; + var source = attribute.toString(); + return source.indexOf('function anonymous()\n{\n') === 0 ? source.slice(23, -2) : null; }, style: function(element) { -- 1.5.5.1015.g9d258