Improve previous getter / setter check in Bootstrap.

This commit is contained in:
Jürg Lehni 2011-02-16 00:40:10 +00:00
parent 8a0a0712cd
commit a7dc48951d

View file

@ -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);
}
}, {}));