Skip to content

Commit

Permalink
fix(compat): don't bind function from globalProperties to the current…
Browse files Browse the repository at this point in the history
… istance if it has additional properties

close #4403
  • Loading branch information
LinusBorg committed Oct 28, 2021
1 parent 5eb7263 commit 0fdaabc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/runtime-core/src/componentPublicInstance.ts
Expand Up @@ -356,7 +356,9 @@ export const PublicInstanceProxyHandlers: ProxyHandler<any> = {
return desc.get.call(instance.proxy)
} else {
const val = globalProperties[key]
return isFunction(val) ? val.bind(instance.proxy) : val
return isFunction(val) && Object.keys(val).length === 0
? val.bind(instance.proxy)
: val
}
} else {
return globalProperties[key]
Expand Down

0 comments on commit 0fdaabc

Please sign in to comment.