mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Check toString after loading remote properties
This commit is contained in:
@@ -175,11 +175,16 @@ const proxyFunctionProperties = function (remoteMemberFunction, metaId, name) {
|
||||
return true
|
||||
},
|
||||
get: (target, property, receiver) => {
|
||||
if (property === 'toString' && typeof target.toString === 'function') {
|
||||
return target.toString.bind(target)
|
||||
}
|
||||
if (!target.hasOwnProperty(property)) loadRemoteProperties()
|
||||
return target[property]
|
||||
const value = target[property]
|
||||
|
||||
// Bind toString to target if it is a function to avoid
|
||||
// Function.prototype.toString is not generic errors
|
||||
if (property === 'toString' && typeof value === 'function') {
|
||||
return value.bind(target)
|
||||
}
|
||||
|
||||
return value
|
||||
},
|
||||
ownKeys: (target) => {
|
||||
loadRemoteProperties()
|
||||
|
||||
Reference in New Issue
Block a user