From 49a8ea24af1ce0dc4cc8ec53b43e954087c8bd3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sat, 19 Oct 2013 12:08:04 +0200 Subject: [PATCH] No need for Object.getPrototypeOf(). Simply point _filtering directly at the original object. --- src/core/Base.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/Base.js b/src/core/Base.js index cd025f5b..16b533d3 100644 --- a/src/core/Base.js +++ b/src/core/Base.js @@ -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.