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 Nov 26, 2021
1 parent 1149e82 commit 7c1a9c7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/runtime-core/src/componentPublicInstance.ts
Original file line number Diff line number Diff line change
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 7c1a9c7

Please sign in to comment.