* The ``apply()`` method calls the specified function with a given this * value, and arguments provided as an array (or an array-like object). Like * :js:meth:`Function.apply`. * * @param thisArg The ``this`` argument. Has no effect unless the * :js:class:`~pyodide.ffi.PyCallable` has
(thisArg: any, jsargs: any)
| 2684 | * @returns The result from the function call. |
| 2685 | */ |
| 2686 | apply(thisArg: any, jsargs: any) { |
| 2687 | // Convert jsargs to an array using ordinary .apply in order to match the |
| 2688 | // behavior of .apply very accurately. |
| 2689 | jsargs = function (...args: any) { |
| 2690 | return args; |
| 2691 | }.apply(undefined, jsargs); |
| 2692 | jsargs = _adjustArgs(this, thisArg, jsargs); |
| 2693 | return Module.callPyObject(_getPtr(this), jsargs); |
| 2694 | } |
| 2695 | /** |
| 2696 | * Calls the function with a given this value and arguments provided |
| 2697 | * individually. See :js:meth:`Function.call`. |
no test coverage detected