(func: (source: structs.BindingSource, ...args: any[]) => any)
| 901 | } |
| 902 | |
| 903 | async call(func: (source: structs.BindingSource, ...args: any[]) => any) { |
| 904 | try { |
| 905 | const frame = Frame.from(this._initializer.frame); |
| 906 | const source = { |
| 907 | context: frame._page!.context(), |
| 908 | page: frame._page!, |
| 909 | frame |
| 910 | }; |
| 911 | const result = await func(source, ...this._initializer.args.map(parseResult)); |
| 912 | this._channel.resolve({ result: serializeArgument(result) }).catch(() => {}); |
| 913 | } catch (e) { |
| 914 | this._channel.reject({ error: serializeError(e) }).catch(() => {}); |
| 915 | } |
| 916 | } |
| 917 | } |
| 918 | |
| 919 | function trimUrl(param: any): string | undefined { |
no test coverage detected