mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
No need for Object.getPrototypeOf().
Simply point _filtering directly at the original object.
This commit is contained in:
parent
d59ed6d7c0
commit
49a8ea24af
1 changed files with 4 additions and 4 deletions
|
@ -78,7 +78,7 @@ Base.inject(/** @lends Base# */{
|
|||
// If props is a filtering object, we need to execute hasOwnProperty
|
||||
// on the original object (it's parent / prototype). See _filtered
|
||||
// inheritance trick in the argument reading code.
|
||||
var orig = props._filtering ? Object.getPrototypeOf(props) : props;
|
||||
var orig = props._filtering || props;
|
||||
for (var key in orig) {
|
||||
if (key in this && orig.hasOwnProperty(key)
|
||||
&& (!exclude || !exclude[key])) {
|
||||
|
@ -263,9 +263,9 @@ Base.inject(/** @lends Base# */{
|
|||
var filtered = list._filtered;
|
||||
if (!filtered) {
|
||||
filtered = list._filtered = Base.create(list[0]);
|
||||
// Mark as _filtering so Base#_set() can execute
|
||||
// hasOwnProperty on its parent.
|
||||
filtered._filtering = true;
|
||||
// Point _filtering to the original so Base#_set() can
|
||||
// execute hasOwnProperty on it.
|
||||
filtered._filtering = list[0];
|
||||
}
|
||||
// delete wouldn't work since the masked parent's value would
|
||||
// shine through.
|
||||
|
|
Loading…
Reference in a new issue