Skip to content

Commit 43ee0de

Browse files
committed
🐛 修复特殊function判断
1 parent 647de2e commit 43ee0de

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/runtime/content/utils.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,21 @@ export function proxyContext(global: any, context: any) {
194194
return context[name];
195195
}
196196
if (special[name] !== undefined) {
197+
if (
198+
typeof special[name] === "function" &&
199+
!(<{ prototype: any }>special[name]).prototype
200+
) {
201+
return (<{ bind: any }>special[name]).bind(global);
202+
}
197203
return special[name];
198204
}
199205
if (global[name] !== undefined) {
206+
if (
207+
typeof global[name] === "function" &&
208+
!(<{ prototype: any }>global[name]).prototype
209+
) {
210+
return (<{ bind: any }>global[name]).bind(global);
211+
}
200212
return global[name];
201213
}
202214
}

0 commit comments

Comments
 (0)