| 330 | } |
| 331 | |
| 332 | function cloneCallSite(frame: CallSite) { |
| 333 | const object = {} as CallSite |
| 334 | Object.getOwnPropertyNames(Object.getPrototypeOf(frame)).forEach((name) => { |
| 335 | const key = name as keyof CallSite |
| 336 | // @ts-expect-error difficult to type |
| 337 | object[key] = /^(?:is|get)/.test(name) |
| 338 | ? function () { |
| 339 | return frame[key].call(frame) |
| 340 | } |
| 341 | : frame[key] |
| 342 | }) |
| 343 | object.toString = CallSiteToString |
| 344 | return object |
| 345 | } |
| 346 | |
| 347 | function wrapCallSite(frame: CallSite, state: State) { |
| 348 | // provides interface backward compatibility |