MCPcopy Create free account
hub / github.com/scriptscat/scriptcat / createFuncWrapper

Function createFuncWrapper

src/app/service/content/create_context.ts:299–305  ·  view source on GitHub ↗
(f: () => any)

Source from the content-addressed store, hash-verified

297 let mySandbox: typeof sharedInitCopy | undefined = undefined;
298
299 const createFuncWrapper = (f: () => any) => {
300 return function (this: any) {
301 const ret = f.call(global);
302 if (ret === global) return mySandbox;
303 return ret;
304 };
305 };
306
307 // 用 eventHandling 机制模拟 onxxxxxxx 事件设置
308 // 监听事件实际上的方法是eventObject.handleEvent

Callers 1

createProxyContextFunction · 0.85

Calls 1

callMethod · 0.65

Tested by

no test coverage detected