Skip to content

Commit

Permalink
using hasOwnProperty for object select check
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewplummer committed Nov 29, 2012
1 parent aecaac0 commit f4a98fa
Show file tree
Hide file tree
Showing 12 changed files with 71 additions and 71 deletions.
4 changes: 2 additions & 2 deletions lib/object.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
if(isRegExp(match)) {
return match.test(key);
} else if(isObjectPrimitive(match)) {
return key in match;
return hasOwnProperty(match, key);
} else {
return key === string(match);
}
Expand Down Expand Up @@ -396,7 +396,7 @@
* @method reject(<obj>, <find>, ...)
* @returns Object
* @short Builds a new object containing all values except those specified in <find>.
* @extra When <find> is a string, that single key will be selected. It can also be a regex, rejecting any key that matches, or an object which will match if the key also exists in that object, effectively "subtracting" that object. Multiple selections may also be passed as an array or directly as enumerated arguments. %reject% is available as an instance method on extended objects.
* @extra When <find> is a string, that single key will be rejected. It can also be a regex, rejecting any key that matches, or an object which will match if the key also exists in that object, effectively "subtracting" that object. Multiple selections may also be passed as an array or directly as enumerated arguments. %reject% is available as an instance method on extended objects.
* @example
*
* Object.reject({a:1,b:2}, 'a') -> {b:2}
Expand Down
4 changes: 2 additions & 2 deletions release/1.3.7/precompiled/development/object.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
if(isRegExp(match)) {
return match.test(key);
} else if(isObjectPrimitive(match)) {
return key in match;
return hasOwnProperty(match, key);
} else {
return key === string(match);
}
Expand Down Expand Up @@ -396,7 +396,7 @@
* @method reject(<obj>, <find>, ...)
* @returns Object
* @short Builds a new object containing all values except those specified in <find>.
* @extra When <find> is a string, that single key will be selected. It can also be a regex, rejecting any key that matches, or an object which will match if the key also exists in that object, effectively "subtracting" that object. Multiple selections may also be passed as an array or directly as enumerated arguments. %reject% is available as an instance method on extended objects.
* @extra When <find> is a string, that single key will be rejected. It can also be a regex, rejecting any key that matches, or an object which will match if the key also exists in that object, effectively "subtracting" that object. Multiple selections may also be passed as an array or directly as enumerated arguments. %reject% is available as an instance method on extended objects.
* @example
*
* Object.reject({a:1,b:2}, 'a') -> {b:2}
Expand Down
2 changes: 1 addition & 1 deletion release/1.3.7/precompiled/minified/array.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions release/1.3.7/precompiled/minified/core.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f4a98fa

Please sign in to comment.