fix: remove bad usages of for-in and guard against it (#22616)
* fix: remove bad usages of for-in and guard against it * Apply suggestions from code review Co-Authored-By: Samuel Maddock <samuel.maddock@gmail.com> * Apply suggestions from code review Co-Authored-By: Jeremy Apthorp <jeremya@chromium.org> * Update remote.js Co-authored-by: Samuel Maddock <samuel.maddock@gmail.com> Co-authored-by: Jeremy Apthorp <jeremya@chromium.org>
This commit is contained in:
parent
f4868c9a28
commit
5e4e50c5eb
7 changed files with 11 additions and 11 deletions
|
@ -72,7 +72,7 @@ function wrapArgs (args, visited = new Set()) {
|
|||
members: []
|
||||
}
|
||||
visited.add(value)
|
||||
for (const prop in value) {
|
||||
for (const prop in value) { // eslint-disable-line guard-for-in
|
||||
meta.members.push({
|
||||
name: prop,
|
||||
value: valueToMeta(value[prop])
|
||||
|
@ -219,7 +219,7 @@ function metaToValue (meta) {
|
|||
exception: () => { throw metaToError(meta.value) }
|
||||
}
|
||||
|
||||
if (meta.type in types) {
|
||||
if (Object.prototype.hasOwnProperty.call(types, meta.type)) {
|
||||
return types[meta.type]()
|
||||
} else {
|
||||
let ret
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue