All native objects have prototype now
This commit is contained in:
parent
8cd4612fe0
commit
6e0cde5b24
9 changed files with 12 additions and 12 deletions
|
@ -9,7 +9,7 @@ Object.setPrototypeOf(module.exports, new Proxy({}, {
|
|||
if (!app.isReady()) return
|
||||
|
||||
const protocol = session.defaultSession.protocol
|
||||
if (!protocol.hasOwnProperty(property)) return
|
||||
if (!protocol.__proto__.hasOwnProperty(property)) return
|
||||
|
||||
// Returning a native function directly would throw error.
|
||||
return (...args) => protocol[property](...args)
|
||||
|
@ -18,7 +18,7 @@ Object.setPrototypeOf(module.exports, new Proxy({}, {
|
|||
ownKeys () {
|
||||
if (!app.isReady()) return []
|
||||
|
||||
return Object.getOwnPropertyNames(session.defaultSession.protocol)
|
||||
return Object.getOwnPropertyNames(session.defaultSession.protocol.__proto__)
|
||||
},
|
||||
|
||||
getOwnPropertyDescriptor (target) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue