Added hasOwnProperty check

This ensures that the result output is clean of extended type methods
This commit is contained in:
Shane Thacker 2015-11-01 12:34:54 -06:00
parent 99c15dee95
commit 23160c9fb3

View File

@ -89,11 +89,13 @@
if (typeof result === UNDEF_TYPE) { if (typeof result === UNDEF_TYPE) {
result = {}; result = {};
for (p in props) { for (p in props) {
q = props[p]; if (props.hasOwnProperty(p)){
if (typeof q === OBJ_TYPE) { q = props[p];
result[q[0]] = undefined; if (typeof q === OBJ_TYPE) {
} else { result[q[0]] = undefined;
result[q] = undefined; } else {
result[q] = undefined;
}
} }
} }
} }