mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Change Bootstrap.js to only make beans if gettes has no function parameters defined, in order to avoid beans for functions that start with get but expect arguments when called.
This commit is contained in:
parent
ea9a1d2c47
commit
261fa819d7
1 changed files with 6 additions and 1 deletions
7
lib/bootstrap.js
vendored
7
lib/bootstrap.js
vendored
|
@ -111,7 +111,12 @@ var Base = this.Base = new function() {
|
|||
return val.valueOf();
|
||||
}
|
||||
}
|
||||
if (beans && (bean = name.match(/^(get|is)(([A-Z])(.*))$/)))
|
||||
// Only add getter beans if they do not expect arguments
|
||||
// Functions that should function both with optional
|
||||
// arguments and as beans should not declare the parameters
|
||||
// and use the arguments array internally instead.
|
||||
if (beans && val.length == 0
|
||||
&& (bean = name.match(/^(get|is)(([A-Z])(.*))$/)))
|
||||
beans.push([ bean[3].toLowerCase() + bean[4], bean[2] ]);
|
||||
}
|
||||
if (!res || func || !res.get && !res.set)
|
||||
|
|
Loading…
Reference in a new issue