From a7dc48951dd525fad59c2a0dc038ce564b70b570 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Wed, 16 Feb 2011 00:40:10 +0000 Subject: [PATCH] Improve previous getter / setter check in Bootstrap. --- lib/Bootstrap.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Bootstrap.js b/lib/Bootstrap.js index e389a10a..98cc712a 100644 --- a/lib/Bootstrap.js +++ b/lib/Bootstrap.js @@ -56,12 +56,13 @@ new function() { function field(name, val, dontCheck, generics) { var val = val || (val = describe(src, name)) && (val.get ? val : val.value), - func = typeof val == 'function', res = val, prev = val && val.get ? null : dest[name]; + func = typeof val == 'function', res = val, + prev = preserve || func ? (val && val.get ? name in dest : dest[name]) : null; if (generics && func && (!preserve || !generics[name])) generics[name] = function(bind) { return bind && dest[name].apply(bind, Array.prototype.slice.call(arguments, 1)); } - if ((dontCheck || val !== undefined && has(src, name)) && (!prev || !preserve)) { + if ((dontCheck || val !== undefined && has(src, name)) && (!preserve || !prev)) { if (func) { if (prev && /\bthis\.base\b/.test(val)) { var fromBase = base && base[name] == prev; @@ -4111,4 +4112,3 @@ Fx.Transitions.inject(['Quad', 'Cubic', 'Quart', 'Quint'].each(function(name, i) return Math.pow(p, i + 2); } }, {})); -