Skip to content

Commit 0fdaabc

Browse files
committed
fix(compat): don't bind function from globalProperties to the current istance if it has additional properties
close #4403
1 parent 5eb7263 commit 0fdaabc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/runtime-core/src/componentPublicInstance.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,9 @@ export const PublicInstanceProxyHandlers: ProxyHandler<any> = {
356356
return desc.get.call(instance.proxy)
357357
} else {
358358
const val = globalProperties[key]
359-
return isFunction(val) ? val.bind(instance.proxy) : val
359+
return isFunction(val) && Object.keys(val).length === 0
360+
? val.bind(instance.proxy)
361+
: val
360362
}
361363
} else {
362364
return globalProperties[key]

0 commit comments

Comments
 (0)