Skip to content

Commit

Permalink
stop test from complaining
Browse files Browse the repository at this point in the history
  • Loading branch information
gr0uch committed Oct 12, 2018
1 parent 656c1e1 commit 740bd8c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/record_type/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,13 @@ function validateField (fields, key) {
type.name === value[typeKey].name

// In case this errors due to security sandboxing, just skip this check.
try {
if (!hasMatch) hasMatch = new value[typeKey] instanceof type
}
catch (e) {
hasMatch = true
}
if (!hasMatch)
try {
hasMatch = Object.create(value[typeKey]) instanceof type
}
catch (e) {
hasMatch = true
}

return hasMatch
}))
Expand Down

0 comments on commit 740bd8c

Please sign in to comment.