From e7376b0478b70320b77a7424de73de8507251011 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Mon, 6 May 2013 20:55:58 -0700 Subject: [PATCH] Add support for aliases in Bootstrap.js --- lib/bootstrap.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/bootstrap.js b/lib/bootstrap.js index 71fb4adc..a9aad429 100644 --- a/lib/bootstrap.js +++ b/lib/bootstrap.js @@ -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