Call includes directly on visited array
This commit is contained in:
parent
2cc2b8a146
commit
5da0b856f9
1 changed files with 1 additions and 3 deletions
|
@ -5,14 +5,12 @@ const {ipcRenderer, isPromise, CallbacksRegistry} = require('electron')
|
|||
|
||||
const callbacksRegistry = new CallbacksRegistry()
|
||||
|
||||
var includes = [].includes
|
||||
|
||||
var remoteObjectCache = v8Util.createIDWeakMap()
|
||||
|
||||
// Check for circular reference.
|
||||
var isCircular = function (field, visited) {
|
||||
if (typeof field === 'object') {
|
||||
if (includes.call(visited, field)) {
|
||||
if (visited.includes(field)) {
|
||||
return true
|
||||
}
|
||||
visited.push(field)
|
||||
|
|
Loading…
Reference in a new issue