mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-09-28 00:18:45 +03:00
Added hasOwnProperty check
This ensures that the result output is clean of extended type methods
This commit is contained in:
parent
99c15dee95
commit
23160c9fb3
@ -89,11 +89,13 @@
|
||||
if (typeof result === UNDEF_TYPE) {
|
||||
result = {};
|
||||
for (p in props) {
|
||||
q = props[p];
|
||||
if (typeof q === OBJ_TYPE) {
|
||||
result[q[0]] = undefined;
|
||||
} else {
|
||||
result[q] = undefined;
|
||||
if (props.hasOwnProperty(p)){
|
||||
q = props[p];
|
||||
if (typeof q === OBJ_TYPE) {
|
||||
result[q[0]] = undefined;
|
||||
} else {
|
||||
result[q] = undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user