Add support for aliases in Bootstrap.js

This commit is contained in:
Jürg Lehni 2013-05-06 20:55:58 -07:00
parent d70c9b0464
commit e7376b0478

8
lib/bootstrap.js vendored
View file

@ -97,8 +97,12 @@ var Base = new function() { // Bootstrap scope
// This does even work for prop: 0, as it will just be looked up
// again through describe.
var val = val || (val = describe(src, name))
&& (val.get ? val : val.value),
func = typeof val === 'function',
&& (val.get ? val : val.value);
// Allow aliases to properties with different names, by having
// string values starting with '#'
if (typeof val === 'string' && val[0] === '#')
val = src[val.substring(1)] || val;
var func = typeof val === 'function',
res = val,
// Only lookup previous value if we preserve or define a
// function that might need it for this.base(). If we're