mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Add support for aliases in Bootstrap.js
This commit is contained in:
parent
d70c9b0464
commit
e7376b0478
1 changed files with 6 additions and 2 deletions
8
lib/bootstrap.js
vendored
8
lib/bootstrap.js
vendored
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue